0
votes

I want to do an exact match query with Solr. I have already a solr.textField type to make fuzzy and stemmed searches, but I need to be able to do exact match (or "contains" match) queries, like this

document_1.text_exact: "The fox was jumping on the goose"
document_2.text_exact: "The fox is jumping on the goose"
document_3.text_exact: "The fox is jumping at the goose"

I want to do a query like this:

 text_exact:"The fox is jumping"

and I want solr document_2 and document_3 but not document_1. The same you can do when looking for text in Firefox (you know, with Ctrl-F).

How shoud I define the "text_exact" field in order to accomplish this?

Thanks

1
In the end I just had a problem with multi-word queries, I just had to surround the query with parentheses. Thanks anyway nikhil500.user3769295

1 Answers

0
votes
  1. You need to define a field without stop-words filter.
  2. If you don't want "The fox is jump" to match, then remove stemming filter from the field.
  3. If you don't want "the fox is jumping" to match, then remove the lower case filter from the field.