cancel
Showing results for 
Search instead for 
Did you mean: 

Exact Match in Searches

lee
Champ in-the-making
Champ in-the-making
Is there a way to require an exact matche when doing a lucene query using the search service?

For example this matches any content CONTAINING "Banana"
+@cm:name:"Banana"

However this will return results for "Bananas" and "Banana Leaf".

Is there a way to specify that it can ONLY be "Banana"?
2 REPLIES 2

jpotts
World-Class Innovator
World-Class Innovator
cm:name is a tokenized field so I don't think you can do an exact match against it. You could:

1. create an additional property that's not tokenized
2. write a behavior or similar to sync the data into the new field
3. search on the non-tokenized field.

But that may be more work than you want to do.

Jeff

lee
Champ in-the-making
Champ in-the-making
Ok. Thanks for this Jeff. I'll have a look at trying to do this!