Im using 3.6.2 lucene and I try to write query which will select all docs. Here's some of my code:
searchString = "content:*";
query = parser.parse(QueryParser.escape(searchString));
indexSearcher.search(query, null, collector);
But this request returns only about 25% of docs, I cant get why and how to make such query.
UPDATE
*:*
also didn't select all docs, but replacing query with new MatchAllDocsQuery()
helped, thanks.
Lucene supports single and multiple character wildcard searches within single terms (not within phrase queries). To perform a single character wildcard search use the "?" symbol. To perform a multiple character wildcard search use the "*" symbol. You can also use the wildcard searches in the middle of a term.
To use the Lucene syntax, open the Saved query menu, and then select Language: KQL > Lucene. To search for a range of values, use the bracketed range syntax, [START_VALUE TO END_VALUE] . For example, to find entries that have 4xx status codes, you could enter status:[400 TO 499] .
Lucene is a query language that can be used to filter messages in your PhishER inbox. A query written in Lucene can be broken down into three parts: Field The ID or name of a specific container of information in a database. If a field is referenced in a query string, a colon ( : ) must follow the field name.
Use MatchAllDocsQuery
. It's string representation is *:*
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With