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
2
votes
2 answers

BooleanQuery not working using Lucene.net 3.0.3

Why the first query works but the second does not when using BooleanQuery on Lucene.net? Here is a sample Indexed on field SHOPPING: Shoes for sale Great bargain on shoes and accessories. Buy cheap Shoes, Sneekers and Heels! First Query (works…
imperialx
  • 133
  • 3
  • 15
2
votes
1 answer

Lucene: Search for documents that dont have specific field

I need to select all documents that dont have specific field, and have right value for one field. I am trying to avoid using "null" string as value for fields that are null, so by lucene, those fields are not saved for those documents. Document…
toskebre
  • 385
  • 2
  • 7
  • 18
2
votes
1 answer

How to use a bool Query with function_score in Elasticsearch?

I have 3 types of data [doctor,article,place] which I want to match their documents based on a bool query. but I want to give doctor type a boost of 3, place type a boost of 2 and article a boost of 1.I have a search Query which uses function_score…
Ramin Omrani
  • 3,673
  • 8
  • 34
  • 60
1
vote
0 answers

lucene boolean query with TermQuery?

i got the following code: Lucene.Net.Analysis.Analyzer analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29); var mainQuery = new Lucene.Net.Search.BooleanQuery(); foreach (var str in fields) …
Rafael Herscovici
  • 16,558
  • 19
  • 65
  • 93
1
vote
2 answers

lucene boolean search

I want to know how lucene find documents matching a boolean query like this: "+a +b c", I mean what's its algorithm? Thanks
Shahryar
  • 1,454
  • 2
  • 15
  • 32
1
vote
0 answers

How to use numeric range query with AND/OR using lucene search query

Below is the table ID NAME HEIGHT HEIGHT_UNIT 1 aaaa 12 CM 2 bbbb 12 CM 3 ccaa 100 MM 4 dddd 130 MM 5 ddaa 140 MM I need to write a lucene query where name like "%aa%" height ranges between (12-15)…
1
vote
2 answers

Elastic Search query with should returning 10.000 results but nothing matches

So I have an index of about 60GB data and basically I want to make a query to retrieve 1 specific product based off its reference number. here is my query: GET myindex/_search { "_source": [ "product.ref", "product.urls.*", …
1
vote
1 answer

Logic to test that 2 out of 4 are true

The closest I have got is (((A ↮ B) ∧ (C ∧ D)) ⊽ ((A ∧ B) ∧ (C ↮ D))), but when all 4 are true then the output is true and I don't want that. Ty.
1
vote
1 answer

Is there a way to change the Addition action between 2 occurrence? (In Boolean query)

I have the next Query: curl -X POST "localhost:9200/_search?pretty" -H 'Content-Type: application/json' -d' { "query": { "bool" : { "must" : { "term" : { "message" : { "value": "message", …
Lupidon
  • 599
  • 2
  • 17
1
vote
1 answer

How can we make few tokens to be phrase in elastic search query

I want to search part of query to be considered as phrase .For e.g. I want to search "Can you show me documents for Hospitality and Airline Industry" Here I want Airline Industry to be considered as phrase.I dont find any such settings in…
1
vote
1 answer

ElasticSearch - Multi-match Query returning no hits for data even though its there - NodeJS

I'm trying to fetch a list of items that have the field: resellable: true. Here is my data set I can see by visiting: my-domain.com/_all/listings/_search { "took" : 1, "timed_out" : false, "_shards" : { "total" : 5, "successful" : 5, …
Zach
  • 468
  • 9
  • 17
1
vote
2 answers

How does "must" clause with an array of "match" clauses really mean?

I have an elasticsearch query which looks like this... "query": { "bool": { "must": [{ "match": {"attrs.name": "username"} }, { "match": {"attrs.value": "johndoe"} }] } } ... and documents in the index…
Saurabh Nanda
  • 6,373
  • 5
  • 31
  • 60
1
vote
1 answer

In R programming, what is the difference between the any and | (or) Boolean operator?

(cond1 | cond2 | cond3 | ...) means "is one or more of a bunch of conditions true?" any(cond1, cond2, cond3 ....) means "are any of the conditions true?" As such aren't we saying the same thing here? Are there any advantages of using one over the…
computronium
  • 445
  • 2
  • 11
1
vote
2 answers

CrossRef API query.affiliation for a multi word string

I'm learning to use the CROSSREF rest API, and want to search for all DOI's with affiliation to a given university. How do I create a multi word search query for AND, not AND/OR? There are over 100 million DOI's on CrossRef, but only 8217730 have…
adm
  • 354
  • 5
  • 17
1
vote
1 answer

Perform JPA search in rows with given Ids

I am working on making the search in my application more efficient. The use case that I am trying to solve is that given a set of Ids, perform search only in those given rows. The problem is that the size of this ids is more than 1024. When I use…
1 2
3
8 9