1

A Solr query problem here.

For example, a group checking query: There’s a string spitted by commas field in Solr, such as “Group1, Group2, Group3”. I have parameter which is a list of string, such as “Group3”, “Group4”, “Group5”. In this case the document with “Group1, Group2, Group3” need to be retrieved, because “Group3” is contains in the field.

It’s like SQL “IN”, but I don’t find a way to query such conditions. The problem is Solr doesn’t allow wildcard as first query.

Any solution for this problem? Thanks a lot!

Itay Moav -Malimovka
  • 52,579
  • 61
  • 190
  • 278
卢声远 Shengyuan Lu
  • 31,208
  • 22
  • 85
  • 130
  • 1
    I am not sure to understand your question. What is the problem of using, say, "q={!lucene}*:*&fq={!lucene q.op=OR}groupField:(Group3 Group4 Group5)" – jpountz Mar 08 '12 at 09:57
  • Agreed and the OP needs to make certain that the comma-delimited field in Solr is tokenized or multi-valued. Personally I think the latter option (a multi-valued string) is better. – David Faber Mar 08 '12 at 15:54

1 Answers1

0

Did you make sure the type of the column you are using in your schema is:

<fieldType name="text_country" class="solr.TextField" positionIncrementGap="100">

and not:

<fieldType name="string" class="solr.StrField" sortMissingLast="true" omitNorms="true"/>

Bob Yoplait
  • 2,421
  • 1
  • 23
  • 35