title: Lucene wildcard matching fails on chemical notations(?)
body: <p>Using Hibernate Search Annotations (mostly just <code>@Field(index = Index.TOKENIZED)</code>) I've indexed a number of fields related to a persisted class of mine called Compound. I've setup text search over all the indexed fields, using the <a href="http://lucene.apache.org/java/2_9_3/api/core/index.html?org/apache/lucene/queryParser/MultiFieldQueryParser.html" rel="nofollow noreferrer"><code>MultiFieldQueryParser</code></a>, which has so far worked fine.</p>
  
  <p>Among the fields indexed and searchable is a field called compoundName, with sample values:</p>
  
  <ul>
  <li><code>3-Hydroxyflavone</code></li>
  <li><code>6,4'-Dihydroxyflavone</code></li>
  </ul>
  
  <p>When I search for either of these values in full the related Compound instances are returned. However problems occur when I use the partial name and introduce wildcards:</p>
  
  <ul>
  <li>searching for <code>3-Hydroxyflav*</code> still gives the correct hit, but</li>
  <li>searching for <code>6,4'-Dihydroxyflav*</code> fails to find anything.</li>
  </ul>
  
  <p>Now as I'm quite new to Lucene / Hibernate-search, I'm not quite sure where to look at this point.. I think it might have something to do with the <code>'</code> present in the second query, but I don't know how to proceed.. Should I look into Tokenizers / Analyzers / QueryParsers or something else entirely?</p>
  
  <p>Or can anyone tell me how I can get the second wildcard search to match, preferably without breaking the MultiField-search behavior?</p>
  
  <p>I'm using Hibernate-Search 3.1.0.GA &amp; Lucene-core 2.9.3.</p>
  
  <hr>
  
  <p>Some relevant code bits to illustrate my current approach:</p>
  
  <p>Relevant parts of the indexed Compound class:</p>
  
  <pre><code>@Entity
  @Indexed
  @Data
  @EqualsAndHashCode(callSuper = false, of = { "inchikey" })
  public class Compound extends DomainObject {
      @NaturalId
      @NotEmpty
      @Length(max = 30)
      @Field(index = Index.TOKENIZED)
      private String                  inchikey;
  
      @ManyToOne
      @IndexedEmbedded
      private ChemicalClass           chemicalClass;
  
      @Field(index = Index.TOKENIZED)
      private String                  commonName;
  ...
  }
  </code></pre>
  
  <p>How I currently search over the indexed fields:</p>
  
  <pre><code>String[] searchfields = Compound.getSearchfields();
  MultiFieldQueryParser parser = 
      new MultiFieldQueryParser(Version.LUCENE_29, searchfields, new StandardAnalyzer(Version.LUCENE_29));
  FullTextSession fullTextSession = Search.getFullTextSession(getSession());
  FullTextQuery fullTextQuery = 
      fullTextSession.createFullTextQuery(parser.parse("searchterms"), Compound.class);
  List&lt;Compound&gt; hits = fullTextQuery.list();
  </code></pre>