Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Incomplete
-
1.9
-
None
-
None
-
tomcat 5.5.17
jdk 1.5.x
Description
Hi folks,
i have some trouble using the field queries.
I create documents similar to the following code example:
(The deprecation usage results of having used 1.4.3 before. Just switched to 1.9.1 to check if the error still occurs)
Document document = new Document();
document.add( Field.Keyword( "id", project.getId().toString() ) );
document.add( Field.Keyword( "type", ComponentType.PROJECT.toString() ) );
document.add( Field.Text( "name", project.getName() ) );
document.add( Field.Text( "description", project.getDescription() ) );
...
The indexing process works fine. Searching withing 'name' and 'description' returns the correct result.
I have an xml converted version of the resulting document hit. (the xml is generated using the Document.fields() enumeration)
<?xml version="1.0" encoding="UTF-8"?>
<results>
<document>
<field name="id" indexed="true" stored="true" vector="false" tokenized="false">3</field>
<field name="type" indexed="true" stored="true" vector="false" tokenized="false">PROJECT</field>
<field name="name" indexed="true" stored="true" vector="false" tokenized="true">project 1</field>
<field name="description" indexed="true" stored="true" vector="false" tokenized="true">this is my first project.</field>
</document>
</results>
The following query is the problematic one:
id:3
type:PROJECT
+id:3 +type:PROJECT
+(id:3 type:PROJECT)
none of those return a result.
I'm not really sure if this is a bug, or a missusage of the lucene api.
If've tried version 1.4.3 and 1.9.1 so far.
Would be nice to hear from you guys,
greets
Sebastian