Questions tagged [booleanquery]

This tag is used in information retrieval scenario when you write a query with multiple rules combined with bolean conjunctive predicates.

This tag is used in information retrieval scenario when you write a query with multiple logical rules combined with bolean conjunctive predicates, e.g., AND, OR, NOT.

131 questions
1
vote
0 answers

Execute lucene booleanquery in file huge problems

I 've a problem with my huge nquad file (about 4000 lines) when i execute a boolenquery, i try a query as: Query query1 = new TermQuery(new Term(FIELD_CONTENTS, "Albania")); Query query2 = new TermQuery(new Term(FIELD_CONTENTS, "Hitchcock")); …
dreamman
  • 51
  • 4
1
vote
4 answers

Simplify several boolean conditions java

how would you simplify all these conditions? String s = "The wold is big" if(s.contains("is") || s.contains("are") || s.contains("was") || s.contains("were")) { return s; } Since I have to check several cases like those, is there a way to…
Josh
  • 63
  • 1
  • 5
1
vote
3 answers

Boolean operations on mysql results

I have 3 Mysql tables: [block_value] id_block_value file_id [metadata] id_metadata metadata_name [metadata_value] meta_id value blockvalue_id In these tables, there are pairs: metadata_name = value And list of pairs are put in blocks…
Cyrille
  • 13,905
  • 2
  • 22
  • 41
0
votes
1 answer

How to write a bool query of "(A & B) | C" condition in elasticsearch

Following this question: bool query - must and should on same level, what does it means? I wonder how can I achieve a simple logical query in elasticsearch using the bool query: (A & B) | C where A, B, and C are all match queries needed to be…
Corel
  • 581
  • 3
  • 21
0
votes
1 answer

How to store multilevel conditions in an array

I want to code a function to handle definable conditions. The reference data is contained in an object and a simple condition is stored in a 3 elements array like this : ["name", "==", "John Doe"] here is the code that works well to test a simple…
0
votes
0 answers

How to Convert string to boolean with function CASE WHEN in PostgreSQL

Full Query: SELECT '' as [id], a.OrganizationId as [organization_id], a.AdmissionNo as [admission_no], a.AdmissionDate as [admission_date], p.MrNo as [mr_no], p.Name as [name], p.BirthDate as…
0
votes
0 answers

How to use BM25 in Opensearch or ElasticSearch script scoring

I am looking to create a Opensearch query that uses a boolean query then calculates two scores of the returned documents. One BM25 score of a given query, for example: "A robot with two mechanical arms to be used in moving large objects" and one…
0
votes
3 answers

How can I go through two arrays and check if the information matches

I have two arrays of objects. One with a json variable and one with an information variable. The information variable is the one that should be equal to the json variable. This is because, information is data from the front and json is data from the…
0
votes
1 answer

Elastic search boolean query object array should clause

Given doc: books [ { name: "book a", authors: [ { name: "John", } { name: "Paul" } ] }, { name: "book b", authors: [ { name: "Paul" } ] } ] Goal: Return the book which match name = book a AND…
Shawn Yeung
  • 99
  • 1
  • 6
0
votes
2 answers

How to create boolean queries on excel including two or more items in a list?

I'm trying to create a boolean query in excel that will include every variation of any two items in a list. To demonstrate, let's say my dataset is: A B C D I'd like to create a formula which outputs ("A" AND "B") OR ("A" AND "C") OR ("A" AND "D")…
0
votes
0 answers

Elasticsearch bool query join order

Raising this question to know the order in which ES executes query clauses (must, should, filter, must_not) that are part of bool query. Sharing the sample query from ES docs - { "query": { "bool" : { "must" : { "term" : {…
V1666
  • 185
  • 3
  • 14
0
votes
0 answers

Boolean Query with match by multiple fields (in two different document)

i have the following query: GET index-*/_search { "size": 0, "query": { "bool": { "must": [], "filter": [ { "match_all": {} }, { "bool": { "should": [ { …
0
votes
0 answers

How can I "replace" NoneType objects in Pandas if Python package raises error?

I am using the eldar package in Python to write boolean queries. The dataframes on which I am running my queries contain a lot of empty cells, which are read as NoneType objects. Eldar, however, raises an error as one of the operations it performs…
OnceUponATime
  • 450
  • 4
  • 12
0
votes
0 answers

Highlighting text using Query/BooleanQuery with multi query clauses in lucene.net

i am trying to do highlighting on multifields using a booleanquery with multiple clauses in lucene.net (version 3.0.3 or 4.8.0-beta00014). Sample document inside an index would be like: {Document
0
votes
1 answer

Assign custom scores to clauses in boolean query in Elasticsearch

In Elasticsearch I am testing the following query: GET sdata/_search { "query": { "bool": { "must": [ { "match": { "f1": "sth" } } ], "should": [ { "match": { "f2": "sth" } } ] } } } I know that…
ammcom
  • 992
  • 1
  • 7
  • 24
1 2 3
8 9