Coder Social home page Coder Social logo

Comments (7)

coleifer avatar coleifer commented on May 19, 2024

What SQLite full-text search version were you using previously? Was your SQLite compiled with support for FTS5?

from scout.

coleifer avatar coleifer commented on May 19, 2024

You know, I'm not sure that this actually worked as you described it... I tried running some SQL locally:

-- create fts4 and fts5 tables
create virtual table idx4 using "fts4" (content);
create virtual table idx5 using "fts5" (content);

-- insert 3 sample rows into each
insert into idx4 (content) values ('hello world'), ('this is a test'), ('python is wonderful');
insert into idx5 (content) values ('hello world'), ('this is a test'), ('python is wonderful');

-- query index using complete and partial strings
select * from idx4 where idx4 match 'hello';
-- returns hello world

select * from idx4 where idx4 match 'hell';
-- no results returned

select * from idx4 where idx4 match 'ello';
-- no results returned

select * from idx5 where idx5 match 'hello';
-- returns hello world

select * from idx5 where idx5 match 'hell';
-- no results returned

select * from idx5 where idx5 match 'ello';
-- no results returned

from scout.

coleifer avatar coleifer commented on May 19, 2024

Y'know, I think this might be the difference that is causing the issue you've seen:

scout/scout.py

Line 108 in 3107c01

'prefix': [2, 3],

Let me re-add the prefix option and see what happens.

from scout.

coleifer avatar coleifer commented on May 19, 2024

Well, that didn't really change anything :/ Nevermind.

from scout.

coleifer avatar coleifer commented on May 19, 2024

Feel free to add more info here in the comments. In the meantime I am going to close this.

from scout.

rajatsingla avatar rajatsingla commented on May 19, 2024

Funnily enough this doesn't work for english, works for hindi.

-- create fts4 and fts5 tables
create virtual table idx4 using "fts4" (content);
create virtual table idx5 using "fts5" (content);

-- insert 1 sample rows into each
insert into idx4 (content) values ('नीरजा भनोट के कातिल पाकिस्तान की जेल में थे, फिर वे एफबीआई आए?');
insert into idx5 (content) values ('नीरजा भनोट के कातिल पाकिस्तान की जेल में थे, फिर वे एफबीआई आए?');

-- query index using complete and partial strings
select * from idx4 where idx4 match 'पाकिस्तान';
-- returns नीरजा भनोट के कातिल पाकिस्तान की जेल में थे, फिर वे एफबीआई आए?

select * from idx4 where idx4 match 'पाकि';
-- no results returned

select * from idx5 where idx5 match 'पाकिस्तान';
-- returns नीरजा भनोट के कातिल पाकिस्तान की जेल में थे, फिर वे एफबीआई आए?

select * from idx5 where idx5 match 'पाकि';
-- returns नीरजा भनोट के कातिल पाकिस्तान की जेल में थे, फिर वे एफबीआई आए?

from scout.

coleifer avatar coleifer commented on May 19, 2024

Strange! I have no idea what's going on but you may want to bring this up on the SQLite-users mailing list if you're curious for more details.

from scout.

Related Issues (8)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.