Hi, thanks for getting back to me.
Here is the syntax:
/cli
DROP table tags_test
/cli
CREATE TABLE tags_test (model_name string, itemid integer, catid integer, tags text)
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Bus",
"itemid": 1,
"catid": 31,
"tags": ""
}
}
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Car",
"itemid": 2,
"catid": 31,
"tags": "color:red"
}
}
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Car",
"itemid": 3,
"catid": 31,
"tags": "color:blue"
}
}
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Car",
"itemid": 4,
"catid": 31,
"tags": ""
}
}
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Bus",
"itemid": 5,
"catid": 31,
"tags": "color:blue"
}
}
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Bus",
"itemid": 6,
"catid": 12,
"tags": ""
}
}
/insert
{
"index": "tags_test",
"doc": {
"model_name": "Bus",
"itemid": 7,
"catid": 88,
"tags": ""
}
}
/search
{
"index": "tags_test",
"_source": [
"model_name",
"itemid",
"catid",
"tags"
],
"limit": 1000,
"query": {
"bool": {
"must": [
{
"equals": {
"catid": 31
}
},
{
"bool": {
"should": [
{
"bool": {
"must": [
{
"in": {
"model_name": [
"Car"
]
}
},
{
"match_phrase": {
"tags": "red"
}
}
]
}
},
{
"in": {
"model_name": [
"Bus"
]
}
}
]
}
}
]
}
}
}
For me, this returns:
{
"took": 0,
"timed_out": false,
"hits": {
"total": 5,
"total_relation": "eq",
"hits": [
{
"_id": "4685708705916623284",
"_score": 1,
"_source": {
"itemid": 2,
"catid": 31,
"model_name": "Car",
"tags": "color:red"
}
},
{
"_id": "4685708705916623285",
"_score": 1,
"_source": {
"itemid": 3,
"catid": 31,
"model_name": "Car",
"tags": "color:blue"
}
},
{
"_id": "4685708705916623286",
"_score": 1,
"_source": {
"itemid": 4,
"catid": 31,
"model_name": "Car",
"tags": ""
}
},
{
"_id": "4685708705916623287",
"_score": 1,
"_source": {
"itemid": 5,
"catid": 31,
"model_name": "Bus",
"tags": "color:blue"
}
},
{
"_id": "4685708705916623283",
"_score": 1,
"_source": {
"itemid": 1,
"catid": 31,
"model_name": "Bus",
"tags": ""
}
}
]
}
}
searchd -v
Manticore 5.0.2 348514c86@220530 dev (columnar 1.15.4 2fef34e@220522) (secondary 1.15.4 2fef34e@220522)
Copyright (c) 2001-2016, Andrew Aksyonoff
Copyright (c) 2008-2016, Sphinx Technologies Inc (http://sphinxsearch.com)
Copyright (c) 2017-2022, Manticore Software LTD (https://manticoresearch.com)