Skip to content

Instantly share code, notes, and snippets.

@riffraff
Created May 26, 2009 13:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save riffraff/118069 to your computer and use it in GitHub Desktop.
Save riffraff/118069 to your computer and use it in GitHub Desktop.
Solr:
<fieldtype name="parsedType" indexed="true" stored="true" compressed="true" class="solr.TextField" sortMissingLast="true">
<analyzer class="org.apache.lucene.analysis.SimpleAnalyzer"/>
</fieldtype>
<field name="name"type="parsedType" required="true" multiValued="false"/>
document.addField(NAME, name);
solrServer.add(document);
Lucene:
writer = new IndexWriter(directory, new SimpleAnalyzer(),
IndexWriter.MaxFieldLength.LIMITED);
document.add(new Field(NAME, name, Field.Store.COMPRESS, Field.Index.ANALYZED);
writer.addDocument(document);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment