// Artifact Reference
doc.addFieldTokenized( ArtifactKeys.GROUPID, filecontent.getArtifact().getGroupId() );
doc.addFieldExact( ArtifactKeys.GROUPID_EXACT, filecontent.getArtifact().getGroupId() );
- doc.addFieldTokenized( ArtifactKeys.ARTIFACTID, filecontent.getArtifact().getArtifactId() );
- doc.addFieldExact( ArtifactKeys.ARTIFACTID_EXACT, filecontent.getArtifact().getArtifactId() );
+ doc.addFieldTokenized( ArtifactKeys.ARTIFACTID, filecontent.getArtifact().getArtifactId(), 1.5f );
+ doc.addFieldExact( ArtifactKeys.ARTIFACTID_EXACT, filecontent.getArtifact().getArtifactId(), 1.5f );
doc.addFieldTokenized( ArtifactKeys.VERSION, filecontent.getArtifact().getVersion() );
doc.addFieldExact( ArtifactKeys.VERSION_EXACT, filecontent.getArtifact().getVersion() );
doc.addFieldTokenized( ArtifactKeys.TYPE, filecontent.getArtifact().getType() );
return this;
}
+ public LuceneDocumentMaker addFieldTokenized( String key, String value, float boost )
+ {
+ if ( value != null )
+ {
+ Field field = new Field( key, value, Field.Store.YES, Field.Index.TOKENIZED );
+ field.setBoost(boost);
+ document.add( field );
+ }
+
+ return this;
+ }
+
public LuceneDocumentMaker addFieldTokenized( String key, List list )
{
if ( ( list != null ) && ( !list.isEmpty() ) )
return this;
}
+ public LuceneDocumentMaker addFieldUntokenized( String name, String value, float boost )
+ {
+ if ( value != null )
+ {
+ Field field = new Field( name, value, Field.Store.YES, Field.Index.UN_TOKENIZED );
+ field.setBoost(boost);
+ document.add( field );
+ }
+
+ return this;
+ }
+
public LuceneDocumentMaker addFieldExact( String name, String value )
{
if ( value != null )
return this;
}
+ public LuceneDocumentMaker addFieldExact( String name, String value, float boost )
+ {
+ if ( value != null )
+ {
+ Field field = new Field( name, value, Field.Store.NO, Field.Index.UN_TOKENIZED );
+ field.setBoost(boost);
+ document.add( field );
+ }
+
+ return this;
+ }
+
public Document getDocument()
{
return this.document;