Field value is 1 or true in solr search results

I have one field that is indexed as a string in the Solr schema.xml file, which is from a boolean (tinyint) column in the mysql database.

In the query, I searched for this field using 1. But without any changes, this query cannot return the correct results, as it was done. After I used true instead of 1, it worked again. Now it goes wrong again, but with true, no problem with 1.

What is the problem here? Do I need to change the type of a field in schema.yml to an integer?

Thanks in advance.

+3
source share
1 answer

, , . "true" / "false" "1" / "0" "on"/ "off" .. , , "true", "1".

, , :

<field name="inStock" type="boolean" indexed="true" stored="true" />

fieldType ( ):

<fieldType name="boolean" class="solr.BoolField" sortMissingLast="true" omitNorms="true"/>

.

+5

Source: https://habr.com/ru/post/1783794/


All Articles