Hi,
thank for your response.
The problem is that i make this query by Spring Data Solr and i have to make 
complex  AND/OR.
Example :

( department:foods AND macro_category.key:drinks) OR ( department:foods AND 
macro_category.key:food)

What is the best practice the make complex AND/OR query and tagging?

Thanks,
Filippo
> On 18 Feb 2016, at 11:19, Mikhail Khludnev <mkhlud...@griddynamics.com> wrote:
> 
> just do
> fq={!tag=DEPARTMENT}department:foods&fq={!tag=MACROCATEGORY}macro_category.key:drinks
> tagging in the middle of the query may somehow work, but it's not a
> recommended way.
> 
> On Thu, Feb 18, 2016 at 11:48 AM, Filippo La Torre <
> filippo.lato...@stentle.com> wrote:
> 
>> Hello everyone,
>> 
>> this is my first mail to solr user mailing list.
>> I’m new to Solr too, my Solr version is 5.4.1.
>> I have a problem with filter query and faceting, i have to make a filter
>> query with AND/OR using also faceting (i will make this query using Spring
>> Data Solr).
>> It seems that the same filter query with brackets and without brackets
>> give different result. The version with brackets don’t see tag/exclude. How
>> it is possible?
>> 
>> Best regards.
>> 
>> With brackets:
>> 
>> {
>>  "responseHeader": {
>>    "status": 0,
>>    "QTime": 2,
>>    "params": {
>>      "q": "*:*",
>>      "facet.field": "{!ex=DEPARTMENT,MACROCATEGORY}macro_category.key",
>>      "indent": "true",
>>      "fq": "({!tag=DEPARTMENT}department:foods AND
>> {!tag=MACROCATEGORY}macro_category.key:drinks)",
>>      "wt": "json",
>>      "facet": "true",
>>      "_": "1455700122431"
>>    }
>>  },
>>  "response": {
>>    "numFound": 1,
>>    "start": 0,
>>    "docs": [
>>      {
>>        "id": "5672a222fa4d0e4c0d965cc5",
>>        "published": true,
>>        "micro_category.key": "drinks-beer",
>>        "department": "foods",
>>        "macro_category.key": "drinks",
>>        "retail_price": 1,
>>        "selling_price": 1
>>      }
>>    ]
>>  },
>>  "facet_counts": {
>>    "facet_queries": {},
>>    "facet_fields": {
>>      "macro_category.key": [
>>        "drinks",
>>        1,
>>        "box-collection",
>>        0
>>      ]
>>    },
>>    "facet_dates": {},
>>    "facet_ranges": {},
>>    "facet_intervals": {},
>>    "facet_heatmaps": {}
>>  }
>> }
>> 
>> Without brackets:
>> 
>> {
>>  "responseHeader": {
>>    "status": 0,
>>    "QTime": 1,
>>    "params": {
>>      "q": "*:*",
>>      "facet.field": "{!ex=DEPARTMENT,MACROCATEGORY}macro_category.key",
>>      "indent": "true",
>>      "fq": "{!tag=DEPARTMENT}department:foods AND
>> {!tag=MACROCATEGORY}macro_category.key:drinks",
>>      "wt": "json",
>>      "facet": "true",
>>      "_": "1455702347556"
>>    }
>>  },
>>  "response": {
>>    "numFound": 1,
>>    "start": 0,
>>    "docs": [
>>      {
>>        "id": "5672a222fa4d0e4c0d965cc5",
>>        "published": true,
>>        "micro_category.key": "drinks-beer",
>>        "department": "foods",
>>        "macro_category.key": "drinks",
>>        "retail_price": 1,
>>        "selling_price": 1
>>      }
>>    ]
>>  },
>>  "facet_counts": {
>>    "facet_queries": {},
>>    "facet_fields": {
>>      "macro_category.key": [
>>        "box-collection",
>>        2,
>>        "drinks",
>>        1
>>      ]
>>    },
>>    "facet_dates": {},
>>    "facet_ranges": {},
>>    "facet_intervals": {},
>>    "facet_heatmaps": {}
>>  }
>> }
> 
> 
> 
> 
> -- 
> Sincerely yours
> Mikhail Khludnev
> Principal Engineer,
> Grid Dynamics
> 
> <http://www.griddynamics.com>
> <mkhlud...@griddynamics.com>

Reply via email to