Lucene fuzzy index...

318 views
Skip to first unread message

kiteflo

unread,
Feb 15, 2013, 12:20:55 PM2/15/13
to ne...@googlegroups.com
Hi guys,

we want to take advantage from the lucene index features, we are trying to fire down a fuzzy search via cypher which should enable us to find a node called "Okidoki Kinderland" based on the spelling "Oki Doki Kinderland", "Ohki Dohki Kinder" etc.;

Lucene therefore provides a syntax similar to "searchstring~0.3", the number specifies the "fuzzy factor".

The query from my guess should look like this:
start offer = node:offerSearch(name:'Okidoki~0.2') return offer

But actually this one does not work, can you help us in how to fire down a fuzzy search using cypher?

Cheers, Florian...

Tero Paananen

unread,
Feb 15, 2013, 12:49:41 PM2/15/13
to ne...@googlegroups.com
> The query from my guess should look like this:
> start offer = node:offerSearch(name:'Okidoki~0.2') return offer

start offer = node:offerSearch('name : "Okidoki"~0.2') return offer

should work. So single quotes around the whole thing, and double
quotes around the search term.

-TPP

kiteflo

unread,
Feb 15, 2013, 4:45:33 PM2/15/13
to ne...@googlegroups.com
Hi Tero,

thanx for your post - did not work but swapping the quotes works like charm, so heres the query:

start offer = node:offerSearch("name : 'Okidok'~0.2") return offer

Tghank your for solving our issue, cheers - FLorian;

Tero Paananen

unread,
Feb 15, 2013, 11:13:14 PM2/15/13
to ne...@googlegroups.com
> thanx for your post - did not work but swapping the quotes works like
> charm, so heres the query:
>
> start offer = node:offerSearch("name : 'Okidok'~0.2") return offer
>
> Tghank your for solving our issue, cheers - FLorian;

Cool. I could've sworn it was the other way around. I even
looked at our old server logs.

Oh well, glad you got it working!

-TPP


Aris Fergadis

unread,
Dec 12, 2014, 10:57:27 AM12/12/14
to ne...@googlegroups.com
I noticed that if my search string has spaces eg "Oki Doki" using

start offer = node:offerSearch('name : "Oki Doki"~0.2') return offer

throws an error. My workaround was to write:

start offer = node:offerSearch("name : \"Oki Doki\"~0.2") return offer

Using neo4j 2.1.5 version.

gg4u

unread,
Aug 9, 2015, 12:15:23 PM8/9/15
to Neo4j
Hi All,

Can you please explain how ranking is done in fuzzy AND normal full-text search?
Here using wikipedia topics as test, and still have very odd results:

start n=node:topic("name:'DNA'~0") return n limit 6;
start n=node:topic("name:'DNA'~0.3") return n limit 6;

return same Sakartvelos Gogona Skautebis Asociacia 'Dia'

as first result;
changing fuzzy to ~0.8 gives no results.

start n=node:topic("name:'united states'~0.3") return n limit 6;

gives no result for any fuzzy parameter.

start n=node:topic('name:united states') return n limit 6;
gives:

List of United States National Historic Landmarks in United States commonwealths and territories, as...

as first result, instead of 'united states' as expected (which is present in my db).



How does fuzzy search and normal START search in legacy index work?
I need to hit more pertinent results and do a little traversal in the same query.
Reply all
Reply to author
Forward
0 new messages