Press Ctrl / CMD + C to copy this to your clipboard.
Copied to clipboard
Flag this post as spam?
This post will be reported to the moderators as potential spam to be looked at
Topic author was deleted
Jun 16, 2016 @ 09:15
Examine, Lucene, escaping chars and wildchar issue
Got a small issue I’m trying to solve here, got a search running with examine and trying to search for words that contain a - (so that needs to be escaped) if I combine that with a wildcard char I get no results, anyone who can explain that? So this works (returns results for the word fit-o-meter)
Well contents:fit-o-mete* is part of my generated criteria, and I'm just using the dashboard examine control to execute a raw lucene query against the index...
Ignore that last comment. In luke find a document that acutally has that term then look at the contents field in luke what do you see?
I think it may be something todo with analyser not tokenising due to the - so for first query its exact match but for second query its going to try partial match on tokens but those individual tokens do not exist.
Topic author was deleted
Examine, Lucene, escaping chars and wildchar issue
Got a small issue I’m trying to solve here, got a search running with examine and trying to search for words that contain a - (so that needs to be escaped) if I combine that with a wildcard char I get no results, anyone who can explain that? So this works (returns results for the word fit-o-meter)
contents:fit\-o\-meter
but this doesn’t return any results
contents:fit\-o\-mete*
Tim,
Whats the generated query? So do a criteria.tostring
Regards
Ismial
Comment author was deleted
Well contents:fit-o-mete* is part of my generated criteria, and I'm just using the dashboard examine control to execute a raw lucene query against the index...
Tim,
Try the query in luke java version and then get a breakdown via explain button see what its doing.
Regards
Ismail
Comment author was deleted
Ok thanks Ismail, will give that a go :)
Tim,
Ignore that last comment. In luke find a document that acutally has that term then look at the contents field in luke what do you see?
I think it may be something todo with analyser not tokenising due to the - so for first query its exact match but for second query its going to try partial match on tokens but those individual tokens do not exist.
Regards
Ismail
Tim,
Bit more digging see http://stackoverflow.com/questions/2600940/hyphens-in-lucene
Comment author was deleted
Thanks!
is working on a reply...