[
https://issues.apache.org/jira/browse/LUCENE-7932?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Erick Erickson resolved LUCENE-7932.
------------------------------------
Resolution: Not A Problem
The default StandardAnalyzer constructor uses a default English stop word set,
which includes "a". So once the stopword is removed from the query,
LocationCode:1 AND Category:a
just becomes
LocationCode:1
You can see this yourself by simply dumping the parsed query with:
System.out.println("parsed query is ' " + q.toString() + "'");
The third query behaves differently because the asterisk makes a* not a
stopword.
Use this constructor to not have stop words:
StandardAnalyzer analyzer = new StandardAnalyzer(CharArraySet.EMPTY_SET);
> Search record with field value='a' or 'A' returns all records along with one
> more field value
> ---------------------------------------------------------------------------------------------
>
> Key: LUCENE-7932
> URL: https://issues.apache.org/jira/browse/LUCENE-7932
> Project: Lucene - Core
> Issue Type: Bug
> Components: core/search
> Affects Versions: 5.3, 6.6
> Environment: Windows and Linux
> Reporter: Rohit Balekundri
> Labels: features
> Attachments: LUCENE-7932 Search record with field value 'a' or 'A'
> returns all records along with one more field value.msg, LuceneQueryTest.java
>
>
> Hi Lucene Team,
> Here I explained more about issue facing after querying using
> org.apache.lucene.search.IndexSearcher API.
> Here I am just giving examples of our project with field names (Not related
> with Lucene):
> In our document which needs to be archived having key fields and non-key
> fields.
> A> Key fields:
> 1. LocationCode (DataType=long)
> 2. CollectionObjectID (DataType=long)
> B> Non-key fields
> Category (DataType=string)
> Steps we followed:
> 1. Step 1: We stored multiple document records with category values as below
> in index files.
> LocationCode = 1 Category =b
> LocationCode = 2 Category =BC
> LocationCode =3 Category =bcd
> 2. In Step 2: we query for records and we pass query parameters as below.
> a) LocationCode=1 and Category =a
> Result= all records displayed
> b) LocationCode=1 and Category =A
> Result= all records displayed
> I faced above issue in Lucene 5.3.
> Later I found even Lucene 6.6 is also having same issue.
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]