Smart Search multivalue field

John Fu asked on September 21, 2015 02:24

I have a field called "Authors" and it contains pipe separated values in there. I've already set this field as searchable, and tokenized. But I can't seem to get the right results when searching. Can someone help me with some search examples?

  1. field contains a single value - 77. Search for 77 should return a result.
  2. field contains 2 values 77|99. - Search for 77 should return a result.
  3. field contains 2 values 77|99. - Search for 77 and 99 should return a result.
  4. field contains 2 values 77|99. - Search for 88 should return no results.
  5. field contains 2 values 77|99. - Search for 77 and 88 should return a result.

My search condition at the moment is +authors:77. But it's not returning anything.

Thanks in advanced. I know Lucene search is not the easiest syntax to grasp.

Correct Answer

John Fu answered on September 21, 2015 09:41

Turned out I had to have "Content" checked instead of Tokenized. I only had Searchable and Tokenized checked.

After that, I had my condition set up as +(authors:(77~) OR (99~)) to pick up documents by both 77 and 99.

0 votesVote for this answer Unmark Correct answer

Recent Answers


Maarten van den Hooven answered on September 21, 2015 07:30 (last edited on September 21, 2015 09:31)

Hi John,

It seems that you do everything the correct way, tokenized and searchable are the right settings and indeed you need to save the data pipe-separated.

I tried it in my example site and : mysite.com/Search?searchtext=+Author:5 gives the correct results.

So this value +authors:77 in the querystring searchtext should return results. So my guess is that or the field is not indexed or not stored correctly.

You can open de index inside an tool called Luke than you can check if the field is really inside the index. If not then you can try saving again the document, check in de DB if the field is stored (pipe-separated), rebuild the smart search index, clear the cache to be sure and then try it again.

Good luck!!!!

If this answer helped you, please vote for my answer :-)

1 votesVote for this answer Mark as a Correct answer

Maarten van den Hooven answered on September 21, 2015 10:09

Hi John, nice to hear your problem is solved. It is always a puzzle which checkbox need to be checked for which requirement.

So always I look at the documentation to verify which one I need.

If this answer helped you, please vote for my answer :-)

0 votesVote for this answer Mark as a Correct answer

John Fu answered on September 22, 2015 01:09

Maarten, it's because I couldn't find the answer it in the documentation that I come on the forums to ask. But yes, thank you for your help. Much appreciated.

0 votesVote for this answer Mark as a Correct answer

   Please, sign in to be able to submit a new answer.