Skip to content

Incorrect handling of /pq/{table}/* requests #1811

Closed
@Nick-S-2018

Description

@Nick-S-2018

Now, the requests to any path like /pq/{table}/* produce the same result as /pq/{table}/search, so we should fix this and return an error instead.

curl localhost:9308/cli -d "CREATE TABLE test(title text) type='pq'"

curl -sX PUT localhost:9308/pq/test/doc -d '{
  "query": {
    "match": {
      "title": "bag"
    }
  },
  "filters": ""
}'
{"index":"test","type":"doc","_id":"4614213312626819074","result":"created"}

curl -sX PUT localhost:9308/pq/test/search -d '{
  "query": {
    "percolate": {
      "document": {
        "title": "What a nice bag"
      }
    }
  }
}' | jq
{
  "took": 0,
  "timed_out": false,
  "hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": "test",
        "_type": "doc",
        "_id": "4614213312626819074",
        "_score": "1",
        "_source": {
          "query": {
            "match": {
              "title": "bag"
            }
          }
        },
        "fields": {
          "_percolator_document_slot": [
            1
          ]
        }
      }
    ]
  }
}

curl -sX PUT localhost:9308/pq/test/abc -d '{
  "query": {
    "percolate": {
      "document": {
        "title": "What a nice bag"
      }
    }
  }
}' | jq
{
  "took": 0,
  "timed_out": false,
  "hits": {
    "total": 1,
    "max_score": 1,
    "hits": [
      {
        "_index": "test",
        "_type": "doc",
        "_id": "4614213312626819074",
        "_score": "1",
        "_source": {
          "query": {
            "match": {
              "title": "bag"
            }
          }
        },
        "fields": {
          "_percolator_document_slot": [
            1
          ]
        }
      }
    ]
  }
}

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions