quickwit icon indicating copy to clipboard operation
quickwit copied to clipboard

Search Query will not get the field value when index field type is bytes.

Open geek-frio opened this issue 1 year ago • 1 comments

Describe the bug Quickwit version: 0.3.1 Query will not get the field value when index field type is bytes.

Steps to reproduce (if applicable) Steps to reproduce the behavior:

  1. Config a index that has bytes field.
  2. Ingest data in the index
  3. search index value like this: quickwit index search --index xxx --query "*"
  4. The bytes field value will not returned.

After reviewing the code, I find the problem is occured here:

图片

we got a json array type value from tantivy, but the field type is set to json string type when do config mapping operation.

图片

Expected behavior Return the base64 encoded field value.

Configuration: Please provide: quickwit version: 0.3.1

geek-frio avatar Sep 30 '22 04:09 geek-frio

Thanks @geek-frio for the report.

I just opened an issue on tantivy side as documents are first serialized into json at the leaf search level when we call fetch_docs function. At this level, we just used tantivy schema.to_json method to serialize a tantivy document.

It is only at the root level that we use the doc mapper to convert a flat json object into a json object that follows the structure described in the doc mapping.

fmassot avatar Sep 30 '22 08:09 fmassot

@geek-frio We've just merged #2093 which should fix your issue. We now return the base64 encoded value. Sorry for the delay.

I'm closing this now, feel free to reopen if you still have a bug on this.

fmassot avatar Oct 20 '22 15:10 fmassot