Disclaimer: I've only been working (evaluating) Solr for three weeks.

I had exactly this issue, and I found that using a field of type string gave
exact matches. So, if you need to do both substring and exact match queries,
you'll need two fields. One non-tokenized field using class StrField and one
tokenized field using class TextField. Very easy to feed into both using
copyField.

Your query would need to use the different field name instead of an exact
operator like with some commercial search engines.

hope that helps,

Andy


Jörg Kiegeland wrote:
> 
> Normally I do substring-queries on my field named X. Now however I also 
> require exact-match queries, however I do not know how to do this!
> 
> If I do
> 
> X:"blabla"
> 
> or
> 
> X:blabla
> 
> 
> .. all documents containing "blabla" in field X are returned. However 
> these are much too much, since I know there is exactly one  document 
> matching "blabla" on field X exactly.
> One solution would be to filter the search result for exact-matches on 
> client side - however can I shift this filtering to Solr somehow?
> 
> 

-- 
View this message in context: 
http://www.nabble.com/exact-matches-not--possible--tp15205318p15206164.html
Sent from the Solr - User mailing list archive at Nabble.com.

Reply via email to