2

I'm working with a dataset that contains multiple fields. I need to conduct searches on several fields simultaneously. Is Weaviate compatible with fielded search? If that is the case, I'd appreciate it if you could instruct me on how to combine many search queries.

This is a scheme:

  schema = {
        "classes": [{
                "class": "Post",
                "vectorizer": "none", # explicitly tell Weaviate not to vectorize anything, we are providing the vectors ourselves through our BERT model
                "properties": [{
                    "name":"pmid",
                    "dataType": ["int"],
                },
                {
                    "name":"title",
                    "dataType": ["text"],
                },
                {
                     "name": "body",
                    "dataType": ["text"],
                }, 
                {
                    "name":"summary",
                    "dataType": ["text"],
                }]
        }]
    }

I'd want to do a simultaneous search on the body and summary. For instance, it identifies publications that have the term "HIV" in their body and summary.

Bob van Luijt
  • 7,153
  • 12
  • 58
  • 101

1 Answers1

0

This is certainly possible. Check out the where-filter in the Weaviate docs :-)

Example based on your example schema.

{
  Get {
    Post(
      nearVector: {
        vector: [0, 0, 0] # <== your custom vector
      }
      where: { # <== searching for a pmid > 12
        operator: GreaterThan
        valueInt: 12
        path: ["pmid"]
      }
    ) {
      pmid
      title
    }
  }
}
Bob van Luijt
  • 7,153
  • 12
  • 58
  • 101