Hi Erick and all

Yes I am trying to apply the same search term to all the 4 search fieldsand 1 of the search field must be an exact match.

You mentioned "In particular, the pf parameter will automatically apply the search terms _as a phrase_ against the field specified, relieving you of having to enclose things in quotes."
I triedbut it is not returning the document.

http://hkenedcdg1.globalsources.com:8983/solr/product/select?q=dvd%20bracket&qf=spp_keyword_exact&defType=edismax&debug=query&pf=spp_keyword_exact&fl=P_ProductId,spp_keyword_exact,P_SPPKW

I may have misunderstood.


On 1/29/2016 1:49 AM, Erick Erickson wrote:
bq: if you are interested phrase query, you should use String field

If you do this, you will NOT be able to search within the string. I.e.
if the doc field is "my dog has fleas" you cannot match
"dog has" with a string-based field.

If you want to match the _entire_ string or you want prefix-only
matching, then string might work, i.e. if you _only_ want to be able
to match

"my dog has fleas"
"my dog*"
but not
"dog has fleas".

On to the root question though.

I really think you want to look at edismax. What you're trying to do
is apply the same search term to individual fields. In particular,
the pf parameter will automatically apply the search terms _as a phrase_
against the field specified, relieving you of having to enclose things
in quotes.

The manual way of doing this would be to construct an elaborate query, like
q=spp_keyword_exact:"dvd bracket" OR P_ShortDescription:(dvd bracket) OR....

NOTE: the parens are necessary or the last part of the above would be
parsed as
P_ShortDescription:dvd default_searchfield:bracket

And the &debug=query trick will show you exactly how things are actually
searched, it's invaluable.

Best,
Erick

On Thu, Jan 28, 2016 at 5:08 AM, Mugeesh Husain <muge...@gmail.com> wrote:
Hi,
if you are interested phrase query, you should use String field instead of
text field in schema like as
  <field name="Field_name" type="string" indexed="true" stored="true"/>

this will solved you problem.

if you are missing anything else let share



--
View this message in context: 
http://lucene.472066.n3.nabble.com/implement-exact-match-for-one-of-the-search-fields-only-tp4253786p4253827.html
Sent from the Solr - User mailing list archive at Nabble.com.



----------------------
CONFIDENTIALITY NOTICE This e-mail (including any attachments) may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please inform the sender immediately and delete this e-mail (including any attachments) from your computer, and you must not use, disclose to anyone else or copy this e-mail (including any attachments), whether in whole or in part.
This e-mail and any reply to it may be monitored for security, legal, 
regulatory compliance and/or other appropriate reasons.

Reply via email to