Query text is always "tokenized" (more properly, "parsed"), unless the text is enclosed in quotes or spaces are escaped with backslash. Try:

q=valueadd:"test . test2"

or

q=valueadd:test\ .\ test2

Parentheses simply provide grouping, either to control boolean operator evaluation order or to apply a field name to a sequence of query tokens (as you have written.)

The analyzer or field type is only consulted when the query is generated, not while it is being parsed. The same identical parsing rules apply to both tokenized and non-tokenized fields. What a field type's analyzer does with its value is irrelevant to query parsing.

-- Jack Krupansky

-----Original Message----- From: Burgmans, Tom
Sent: Thursday, February 28, 2013 10:48 AM
To: solr-user@lucene.apache.org
Subject: Search in String and Text_en fields simultaneously with edismax

I have a field "valueadd" of type String and field "body" of type text_en (with tokenization and linguistic processing).

When I search with edismax against field valueadd like this:
q=valueadd:(test . test2)
I see that the parsed query is
(valueadd:test valueadd:. valueadd:test2)~3

Why not (valueadd:test . test2) ? It looks like the query is tokenized while field type String doesn't have a tokenizer configured.

I know I could construct my query as:
q=valueadd:"test . test2"
in which case the phrase is searched as a whole against valueadd. But why doesn't that happen without quotes?


The reason I ask:
For a simultaneous search in multiple fields I like to include field valueadd in the qf parameter which contains String and text_en fields, like:
&qf=valueadd body

How can I search both fields simultaneously without duplicating search terms, while the query is (whitespace) tokenized for "body" but search as a phrase for "valueadd"?

Thanks,
Tom Burgmans

This email and any attachments may contain confidential or privileged information and is intended for the addressee only. If you are not the intended recipient, please immediately notify us by email or telephone and delete the original email and attachments without using, disseminating or reproducing its contents to anyone other than the intended recipient. Wolters Kluwer shall not be liable for the incorrect or incomplete transmission of
of this email or any attachments, nor for unauthorized use by its employees.

Wolters Kluwer nv has its registered address in Alphen aan den Rijn, The Netherlands, and is registered with the Trade Registry of the Dutch Chamber of Commerce under number 33202517.

Reply via email to