Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tags to http search query #1106

Closed
vlkorsakov opened this issue Apr 25, 2023 · 2 comments
Closed

Add tags to http search query #1106

vlkorsakov opened this issue Apr 25, 2023 · 2 comments

Comments

@vlkorsakov
Copy link

vlkorsakov commented Apr 25, 2023

Is your feature request related to a problem? Please describe.
Please add feature receieve "tags" field in answer for percolate http queries
Without "tags" field i can't put additional context to search results, and i am suffer from that

Describe the solution you'd like
From docs
POST /json/pq/products/_search

{    
  "query": {    
    "percolate": {    
      "document": {    
        "title": "What a nice bag"    
      }    
    }    
  }    
}    

Answer:

{    
  "took": 0,    
  "timed_out": false,    
  "hits": {    
    "total": 1,    
    "max_score": 1,    
    "hits": [    
      {    
        "_index": "products",    
        "_type": "doc",    
        "_id": "1657852401006149644",    
        "_score": "1",    
        "_source": {    
          "query": {    
            "ql": "@title bag"    
          }    
        },    
        "fields": {    
          "_percolator_document_slot": [    
            1    
          ]    
        }    
      }    
    ]    
  }    
}     

I want to have field "tags" for returned query

Describe alternatives you've considered
No alternative

Additional context
I need to get external context while searching, and tags field is pretty good for that.
Unfortunate, i can't get this field during search queries.
Support batch mode too please
https://manual.manticoresearch.com/Searching/Percolate_query

@tomatolog
Copy link
Contributor

fixed at c2823b9 there added tags property into _source and now reply looks like

/json/pq/idx1/search
POST "{ "query": { "percolate": { "documents" : [{ "title" : "A new tree test in the office" }, { "title" : "A cat test in the office" }, { "title" : "A dog test in the office" }] } } }"
{
    "timed_out": false,
    "hits": {
        "total": 3,
        "max_score": 1,
        "hits": [
            {
                "_index": "idx1",
                "_type": "doc",
                "_id": "10",
                "_score": "1",
                "_source": {
                    "query": {
                        "match": {
                            "title": {
                                "query": "dog test",
                                "operator": "and"
                            }
                        }
                    },
                    "tags": "id, id_x10"
                },
                "fields": {
                    "_percolator_document_slot": [
                        3
                    ]
                }
            },

@sanikolaev
Copy link
Collaborator

Done in c2823b9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants