lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ahmet Arslan <iori...@yahoo.com.INVALID>
Subject Re: Exact match on string field with special characters
Date Wed, 01 Oct 2014 21:45:42 GMT
Hi,

raw query parser or term query parser would be handy. 

https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-TermQueryParser

Ahmet



On Thursday, October 2, 2014 12:32 AM, tedsolr <tsmith@sciquest.com> wrote:
I am trying to do SQL like aggregation (GROUP BY) with solr faceting. So I
use string fields for faceting - to try to get an exact match. However, it
seems like to run a facet query I have to surround the value with double
quotes. That poses issues when the field value is

green "bath" towels

-or-

red \cars

Those two special characters must be transformed somehow on indexing so I
can create the query:
(java)
...
String fg = fieldName + ":\"" + fieldValue + "\"";
query.addFacetField(fq);
...

Is there a way to request an exact match search without having to resort to
the quotes? I could possibly convert spaces to underscores at index time,
but I'd like to avoid munging that data because I'm using the string field
for display too! That saves time/searches when aggregating against 10 - 15
fields which takes a whole lot of facet searches to begin with.

Using Solr 4.9 




--
View this message in context: http://lucene.472066.n3.nabble.com/Exact-match-on-string-field-with-special-characters-tp4162209.html
Sent from the Solr - User mailing list archive at Nabble.com.


Mime
View raw message