lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "IT-Servives Polenz (JIRA)" <>
Subject [jira] Created: (LUCENENET-32) Check hashtable in PhraseQuery.ExtractTerms for existing keys
Date Tue, 16 Jan 2007 16:11:27 GMT
Check hashtable in PhraseQuery.ExtractTerms for existing keys

                 Key: LUCENENET-32
             Project: Lucene.Net
          Issue Type: Task
            Reporter: IT-Servives Polenz

It can happen by accident, that an search term exist twice in a query.
If so, Lucene.Net fails with the exception, e.g. 

Item has already been added. Key in dictionary: 'Text:money' Key being added: 'Text:money'
at System.Collections.Hashtable.Insert(Object key, Object nvalue, Boolean add)
at System.Collections.Hashtable.Add(Object key, Object value)
at Lucene.Net.Search.PhraseQuery.ExtractTerms(Hashtable queryTerms)
at Lucene.Net.Search.BooleanQuery.ExtractTerms(Hashtable terms)
at Lucene.Net.Highlight.QueryTermExtractor.GetTerms(Query query, Hashtable terms, Boolean
prohibited, String fieldName)
at Lucene.Net.Highlight.QueryTermExtractor.GetTerms(Query query, Boolean prohibited, String
at Lucene.Net.Highlight.QueryScorer..ctor(Query query)

You should just adopt the method by adding a check whether the key already exists in your
inner hashtable.
This is nothing a Lucene user could handle before sending the query into Lucene, simply because
it's unneccesary work to implement a check of the search phrase before.

This message is automatically generated by JIRA.
If you think it was sent incorrectly contact one of the administrators:
For more information on JIRA, see:


View raw message