OR condition in search...

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

OR condition in search...

escher2k
Is is possible to specify that a term to be looked up in alternate ways"  - e.g.
search = "3 D" OR "3D" ? Reason being, by default, a search for "3D" is being split
into "3 D".

Thanks.
Reply | Threaded
Open this post in threaded view
|

Re: OR condition in search...

Chris Hostetter-3

: search = "3 D" OR "3D" ? Reason being, by default, a search for "3D" is
: being split
: into "3 D".

these seems to relate to your other recent question ... Solr is not
splitting "3D" into "3 D" by default at query time just for hte hell of it
... it's doing that because it's what the analyzer configured for your
fieldtype says it should do .. change your schema.xml to use a differnet
analyzer, and you'll get differnet behavior (not just when indexing, but
when querying too)



-Hoss

Reply | Threaded
Open this post in threaded view
|

Re: OR condition in search...

escher2k
Hoss,
  This is not entirely related to the previous question. I know that the Analyzer configuration
is causing the interpretation to be the way it is. In certain cases, where the typed in field might
have user name such as "kathy_k", we want it to look for the exact expression in addition to
what the Analyzer does.

Chris Hostetter wrote
: search = "3 D" OR "3D" ? Reason being, by default, a search for "3D" is
: being split
: into "3 D".

these seems to relate to your other recent question ... Solr is not
splitting "3D" into "3 D" by default at query time just for hte hell of it
... it's doing that because it's what the analyzer configured for your
fieldtype says it should do .. change your schema.xml to use a differnet
analyzer, and you'll get differnet behavior (not just when indexing, but
when querying too)



-Hoss
Reply | Threaded
Open this post in threaded view
|

Re: OR condition in search...

Chris Hostetter-3

: is causing the interpretation to be the way it is. In certain cases, where
: the typed in field might
: have user name such as "kathy_k", we want it to look for the exact
: expression in addition to
: what the Analyzer does.

i don't know that i understand your question ... if the analyzer is
splitting kathy_k up into two seperate tokens at index time, then you
really *don't* want it to search for "the exact expression" at search
time, becuase you wont' find it, because it hasn't been indexed ... you
want your query time analyzer to be compatible with your index time
analyzer.

what does make sense sometimes is to index more then you search on ... ie:
use WordDelimiterFilter when indexing to index all three tokens:
"kathy_k", "kathy", "k"; and at query time you don't use that FIlter (or
use it with differnet params) so that you'll get a match if a user
searches for "kathy" "kathy_k" or "kathy k"




-Hoss