0

I have this type of ouput genral

"docs": [
  {
    "id": "552e1acd5971b",
    "product_id": "NOT05253",
    "attribute_id": 0,
    "attribute_name": "Brend",
    "value_id": 12923,
    "value_name": "ACER",
    "category_id": 166,
    "_version_": 1498504104368930800
  },
  {
    "id": "552e1acd7d479",
    "product_id": "NOT05604",
    "attribute_id": 0,
    "attribute_name": "Brend",
    "value_id": 12923,
    "value_name": "ACER",
    "category_id": 166,
    "_version_": 1498504104523071500
  },
  {
    "id": "552e1acdc9c7c",
    "product_id": "NOT05988",
    "attribute_id": 0,
    "attribute_name": "Brend",
    "value_id": 12923,
    "value_name": "ACER",
    "category_id": 166,
    "_version_": 1498504104851275800
  },
  {
    "id": "552e1acdef261",
    "product_id": "NOT06361",
    "attribute_id": 0,
    "attribute_name": "Brend",
    "value_id": 12923,
    "value_name": "ACER",
    "category_id": 166,
    "_version_": 1498504105011708000
  }, ..... 

What I'm trying to do is getting results where product_id match at leas one product_id in another query...

category_id:166 AND value_id:12923
AND product_id:( _query_:"value_id:64 " )

I'm using this for making EAV product filtering faster, and this query particular has to shorten product_id count of ACER notebook in variation with 15.6" screen size :)

Another words - something like SQL query:

SELECT * FROM table WHERE value_id=12923 AND product_id IN (SELECT product_id FROM table WHERE value_id=64)

Any toughts? :D

1 Answers1

1

Solr has some Join capabilities described here [1]. It could be what you're looking for.
About the other clauses: I would use a filter query (i.e. fq=value_id:12923)


[1] https://wiki.apache.org/solr/Join

Andrea
  • 2,714
  • 3
  • 27
  • 38