0

I have a Solr 6.5 index with schema: OrderId, OrderType, AirNumber & more..

My document looks like:

"OrderId":"-7878676767676",
"OrderType:"["Fee",
             "Insurance",
             "Air",
             "Fee"]
"AirNumber":["",
             "",
             "[2608620989121, 2608620989123]",
             ""],

When I query for AirNumber, I am not able to retrieve the above order.

q=AirNumber:2608620989121

My schema for AirNumber is:

<field name="AirNumber" type="token" indexed="true" stored="true" multiValued="true" omitTermFreqAndPositions="false"/>

I have tried different combinations to query & I have tried with AirNumber as "string" too, Nothing works. What am I missing?

Preethi
  • 123
  • 8

1 Answers1

1

For string field type it won't work because this field type doesn't tokenize the values, so you would need to query for the exact value "[2608620989121, 2608620989123]".

And for the "token" type, it depends on your configuration of the fieldtype "token".

A way to make it work in your use case is to configure the token field type something like this:

<fieldType name="token" class="solr.TextField" positionIncrementGap="100" multiValued="true">
    <analyzer>
        <tokenizer class="solr.StandardTokenizerFactory"/>
    </analyzer>
</fieldType>

This will make it tokenizes your multivalued input so you'll be able to find each number separately.

Alessandro Hoss
  • 395
  • 4
  • 8