You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Padmanabhan V <pa...@gmail.com> on 2017/05/16 15:32:37 UTC

Solr Index issue on string type while querying

Hello Solr Geeks,

Am looking for some helping hands to proceed on an issue am facing now.
Here given below one record from the prepared index. i could query the
fields without greater than symbol. but when i did query for
widthSquareTube_string_mv & heightSquareTube_string_mv. It is not returning
any result, thought there are records which has some values tagged similar
like below. These two fields are dynamicFields and are of fied type:


*string.*


*Given below the query executed through solr console at Query area1.
*heightSquareTube_string_mv:>
90 - 100 mm

&

2. heightSquareTube_string_mv:"> 90 - 100 mm"


{
"indexOperationId_long": 379908,
"id": "Online/10004003x1500",
"pk": 2558081,
"wallThickessTubeSquare_string_mv": [
"3 - 5.99 mm"
],
"widthSquareTube_string_mv": [
"> 30 - 40 mm"
],
"heightSquareTube_string_mv": [
"> 90 - 100 mm"
],
"length_string_mv": [
"1000 - 1999 mm"
],
"allCategories_string_mv": [
"AL_ST",
"100",
"F000",
"F060",
"AL",
"F061"
],
"category_string_mv": [
"AL_ST",
"100",
"F000",
"F060",
"AL",
"F061"
],
"inStockFlag_boolean": true,
"baseProduct_string": "ST606010004003",
"name_text_de_de": "100 x 40 x 3 x 1500 mm",
"name_sortable_de_de_sortabletext": "100 x 40 x 3 x 1500 mm",
"autosuggest": [
"ST606010004003x1500"
],
"_version_": 1567229255468712000
}


Best Regards,
Padmanabhan.V

RE: Solr Index issue on string type while querying

Posted by padmanabhan <pa...@gmail.com>.
Thank you Matt for the reply. my apologize on the clarity about the problem
statement. 

The problem was with the source attribute value defined at the source
system.

Source system with the 

heightSquareTube_string_mv: &gt; 90 - 100 mm

Solr index converts the xml or html code to its symbol equivalent. 

heightSquareTube_string_mv: > 90 - 100 mm



--
View this message in context: http://lucene.472066.n3.nabble.com/Solr-Index-issue-on-string-type-while-querying-tp4335340p4348788.html
Sent from the Solr - User mailing list archive at Nabble.com.

RE: Solr Index issue on string type while querying

Posted by Matt Kuiper <ma...@issinc.com>.
Your problem statement is not quite clear, however I will make a guess.

Assuming your problem is that when you remove the '>' sign from your query term you receive zero results, then this is actually expected behavior for field types that are of type string.  When searching against string fields you need to match the whole field value exactly.  So the '>' is needed to get a match.  Recommend redefining or adding corresponding fields as type text_general.   This type is tokenized and will allow for the match you are looking for.

Matt

-----Original Message-----
From: Padmanabhan V [mailto:padmanabhan.venkitachalapathy@gmail.com] 
Sent: Tuesday, May 16, 2017 9:33 AM
To: solr-user@lucene.apache.org
Subject: Solr Index issue on string type while querying

Hello Solr Geeks,

Am looking for some helping hands to proceed on an issue am facing now.
Here given below one record from the prepared index. i could query the fields without greater than symbol. but when i did query for widthSquareTube_string_mv & heightSquareTube_string_mv. It is not returning any result, thought there are records which has some values tagged similar like below. These two fields are dynamicFields and are of fied type:


*string.*


*Given below the query executed through solr console at Query area1.
*heightSquareTube_string_mv:>
90 - 100 mm

&

2. heightSquareTube_string_mv:"> 90 - 100 mm"


{
"indexOperationId_long": 379908,
"id": "Online/10004003x1500",
"pk": 2558081,
"wallThickessTubeSquare_string_mv": [
"3 - 5.99 mm"
],
"widthSquareTube_string_mv": [
"> 30 - 40 mm"
],
"heightSquareTube_string_mv": [
"> 90 - 100 mm"
],
"length_string_mv": [
"1000 - 1999 mm"
],
"allCategories_string_mv": [
"AL_ST",
"100",
"F000",
"F060",
"AL",
"F061"
],
"category_string_mv": [
"AL_ST",
"100",
"F000",
"F060",
"AL",
"F061"
],
"inStockFlag_boolean": true,
"baseProduct_string": "ST606010004003",
"name_text_de_de": "100 x 40 x 3 x 1500 mm",
"name_sortable_de_de_sortabletext": "100 x 40 x 3 x 1500 mm",
"autosuggest": [
"ST606010004003x1500"
],
"_version_": 1567229255468712000
}


Best Regards,
Padmanabhan.V