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
28
votes
1 answer

Elasticsearch - combining query_string and bool query in filter

Is it possible to combine query_string and bool query in filter query? For Example - { "filter": { "query_string": { "query": "field:text" } }, "bool": { "should": { "match": { "field": "text" } } …
Deepak
  • 501
  • 1
  • 5
  • 15
27
votes
1 answer

Elastic query DSL: Wildcards in terms filter?

I am trying to filter the documents using terms filter. I am not sure how to introduce wildcards in filter. I tried something like this: "filter":{ "bool":{ "must":{ "terms":{ "wildcard" : { …
Mohitt
  • 2,957
  • 3
  • 29
  • 52
17
votes
2 answers

How can i get count of number of rows that have boolean value true(or 1) in Room persistent database without using SELECT query?

I am working with Room persistent database in my project. I have a table in which there is a column for Boolean values as in 0 or 1, now i want the count of all Boolean values whose value is true (or 1). I know that i can achieve this using select…
15
votes
1 answer

Lucene 6.0! How to instantiate a BooleanQuery and add other search queries in it?

How to instantiate a BooleanQuery in Lucene 6.x ? How to use Boolean Query to add other queries in it ? In Lucene 4.x we use BooleanQuery as follow: BooleanQuery booleanQuery = new BooleanQuery(); booleanQuery.add(query1,…
Mohasin Ali
  • 3,955
  • 1
  • 20
  • 24
14
votes
1 answer

Lucene OR search using Boolean query

I have an index with multiple fields, one of which is a string field in which I store category names for a product... such as "Electronics", "Home", "Garden", etc new StringField("category_name", categoryName, Field.Store.YES)); //categoryName is a…
SoluableNonagon
  • 11,541
  • 11
  • 53
  • 98
14
votes
2 answers

How to do Java String matching using Boolean Search Syntax?

I'm looking for a Java/Scala library that can take an user query and a text and returns if there was a matching or not. I'm processing a stream of information, ie: Twitter Stream, and can't afford to use a batching process, I need to evaluate each…
arjones
  • 460
  • 3
  • 12
9
votes
3 answers

Quick way to check if the pandas series contains a negative value

What is the quickest way to check if the given pandas series contains a negative value. For example, for the series s below the answer is True. s = pd.Series([1,5,3,-1,7]) 0 1 1 5 2 3 3 -1 4 7 dtype: int64
Krzysztof Słowiński
  • 6,239
  • 8
  • 44
  • 62
9
votes
1 answer

Nest Elasticsearch, combining bool query of Must and Should

I want to filter a group of documents by Year, Format and Content. n pseudo-SQL: SELECT * FROM /test/document WHERE ((format=f1|| format=f2||...|| format=fn) AND (Year!=2013 AND Year!=2015) AND (content like %c1% || content like %c2% ||...||…
Mahsa
  • 341
  • 3
  • 17
8
votes
1 answer

How to do bool Queries in ElasticSearch with Java Api?

iam trying to send a bool query against my elasticSearch, that filters out documents. How can i filter boolean expressions like (A AND B AND C) AND (D OR E OR F) AND G with BooleanQueryBuilder Api in Java? I tried with the filter method, but i get…
Robatz Rabauke
  • 101
  • 1
  • 1
  • 2
7
votes
2 answers

What is difference between match and bool must match query in Elasticsearch

What is the difference between Only match and bool must match query in ES? First, Only use the match query { "query":{ "match":{ "address":"mill" } } } Second, use compound query { "query": { "bool": { …
Johnson
  • 147
  • 2
  • 7
7
votes
3 answers

Python Query Processing and Boolean Search

I have an inverted index (as a dictionary) and I want to take a boolean search query as an input to process it and produce a result. The inverted index is like this: { Test : { FileName1: [213, 1889, 27564], FileName2: [133, 9992866, 27272781,…
6
votes
2 answers

Constructing a tree using Python

I am trying to implement a unranked boolean retrieval. For this, I need to construct a tree and perform a DFS to retrieve documents. I have the leaf nodes but I am having difficulty to construct the tree. Eg: query = OR ( AND (maria sharapova)…
5
votes
2 answers

Nest Elastic - Building Dynamic Nested Query

I have to query a nested object using Nest, however the query is built in dynamic way. Below is code that demonstrate using query on nested "books" in a static way QueryContainer qry; qry = new QueryStringQuery() { DefaultField = "name", …
Hussein Salman
  • 7,806
  • 15
  • 60
  • 98
5
votes
2 answers

Using the minus sign on multiple-words in full text boolean mode

I am just doing a bunch of testing with mysql's full text boolean mode and from my testing it doesn't seem you can use the minus sign on multiple words? I have two rows for example.. id,name 1,2011-12 Fleer Retro auto jordan non 2,1999 jordan non…
Brett
  • 19,449
  • 54
  • 157
  • 290
5
votes
3 answers

Boolean Algebra : Prove that

I was having trouble with the following problem in boolean algebra i.e. A+A'B = A+B I need to prove the above section. I mean its already reduced i can't reduce it further.
kishanio
  • 6,979
  • 8
  • 25
  • 33
1
2 3
8 9