Skip to content

Document field types

Strings

These are vectorised, unless the field is specified is in non_tensor_fields during index time.

Floats

These aren't vectorised, but can be used to filter search results.

Bools

These aren't vectorised, but can be used to filter search results.

Ints

These aren't vectorised, but can be used to filter search results.

Array

Currently, only arrays of strings are supported.

Array fields must be given as a non_tensor_fields during index time, else an error will be thrown.

This type of field can be used to filter search results and for lexical search.

Example

# index an array field called "my tags", making sure it is in non_tensor_fields 
mq.index("my_index").add_documents(documents=[
    {"Title": "Cool summer t-shirt", "_id": "1234", 'my tags': ['summer', 'yellow']}], 
    non_tensor_fields=['my tags']
)

# do a search request that filters based on the tags
mq.index("my_index").search(
    q="Something to wear in warm weather",
    filter_string="(my\ tags:yellow) AND (my\ tags:summer)"
)