Search code examples
solrnet

Can SolrNet do exact field value matches?


The one thing I can't find in SolrNet is exact field matches. So, if my field contains exactly "My Name is James Bond," then I'm looking for something like this:

new SolrQueryExactMatch("FieldName", "My Name is James Bond");

I'm effectively looking for SQL-like searching:

WHERE FieldName = 'My Name is James Bond'

I'm wondering if this is a function of indexing? Do we index the field, but not tokenize it? If "My Name is James Bond" was a single token, I'm wondering if that would have the same effect?

Does such a thing exist in SolrNet?


Solution

  • I needed to store the field as a string not as text and then use SolrQueryByField on the value.