title: How to search fields with wildcard and spaces in Hibernate Search
body: <p>I have a search box that performs a search on title field based on the given input, so the user has recommended all available titles starting with the text inserted.It is based on Lucene and Hibernate Search. It works fine until space is entered. Then the result disapear. For example, I want "Learning H" to give me "Learning Hibernate" as the result. However, this doesn't happen. could you please advice me what should I use here instead. </p>
  
  <p><strong>Query Builder:</strong></p>
  
  <pre><code>QueryBuilder qBuilder = fullTextSession.getSearchFactory()
          .buildQueryBuilder().forEntity(LearningGoal.class).get();
    Query query = qBuilder.keyword().wildcard().onField("title")
          .matching(searchString + "*").createQuery();
  
    BooleanQuery bQuery = new BooleanQuery();
    bQuery.add(query, BooleanClause.Occur.MUST);
    for (LearningGoal exGoal : existingGoals) {
       Term omittedTerm = new Term("id", String.valueOf(exGoal.getId()));
       bQuery.add(new TermQuery(omittedTerm), BooleanClause.Occur.MUST_NOT);
    }
    @SuppressWarnings("unused")
    org.hibernate.Query hibQuery = fullTextSession.createFullTextQuery(
          query, LearningGoal.class);
  </code></pre>
  
  <p><strong>Hibernate class</strong>:</p>
  
  <pre><code>@AnalyzerDef(name = "searchtokenanalyzer",tokenizer = @TokenizerDef(factory = StandardTokenizerFactory.class),
  filters = {
    @TokenFilterDef(factory = StandardFilterFactory.class),
    @TokenFilterDef(factory = LowerCaseFilterFactory.class),
    @TokenFilterDef(factory = StopFilterFactory.class,params = { 
        @Parameter(name = "ignoreCase", value = "true") }) })
        @Analyzer(definition = "searchtokenanalyzer")
  public class LearningGoal extends Node {
  </code></pre>