And keep in mind you do need quotes around your searchTerm if it consists
of multiple words - q=text_exact_field:"your_unquoted_query"
otherwise Solr will interpret "two words" as: "exact_field:two
defaultfield:words"

(Maybe not directly applicable for your problem Kristian, but I just want
to mention that there are a few StemFilters available, maybe another one
acts differently!)


On 21 February 2013 21:52, SUJIT PAL <sujit....@comcast.net> wrote:

> You could also do this outside Solr, in your client. If your query is
> surrounded by quotes, then strip away the quotes and make
> q=text_exact_field:your_unquoted_query. Probably better to do outside Solr
> in general keeping in mind the upgrade path.
>
> -sujit
>
> On Feb 21, 2013, at 12:20 PM, Van Tassell, Kristian wrote:
>
> > Thank you.
> >
> > So essentially I need to write a custom query parser (extending upon
> something like the QParser)?
> >
> > -----Original Message-----
> > From: Upayavira [mailto:u...@odoko.co.uk]
> > Sent: Thursday, February 21, 2013 12:22 PM
> > To: solr-user@lucene.apache.org
> > Subject: Re: Matching an exact word
> >
> > Solr will only match on the terms as they are in the index. If it is
> stemmed in the index, it will match that. If it isn't, it'll match that.
> >
> > All term matches are (by default at least) exact matches. Only with
> stemming you are doing an exact match against the stemmed term.
> > Therefore, there really is no way to do what you are looking for within
> Solr. I'd suggest you'll need to do some parsing at your side and, if you
> find quotes, do the query against a different field.
> >
> > Upayavira
> >
> > On Thu, Feb 21, 2013, at 06:17 PM, Van Tassell, Kristian wrote:
> >> I'm trying to match the word "created". Given that it is surrounded by
> >> quotes, I would expect an exact match to occur, but instead the entire
> >> stemming results show for words such as create, creates, created, etc.
> >>
> >> q="created"&wt=xml&rows=1000&qf=text&defType=edismax
> >>
> >> If I copy the text field to a new one that does not stem words,
> >> "text_exact" for example, I get the expected results:
> >>
> >> q="created"&wt=xml&rows=1000&qf=text_exact&defType=edismax
> >>
> >> I would like the decision whether to match exact or not to be
> >> determined by the quotes rather than the qf parameter (eg, not have to
> >> use it at all). What topic do I need to look into more to understand
> >> this? Thanks in advance!
> >>
>
>

Reply via email to