I agree. Actually that top-level logic is fine. its the loop that follows thats wrong: it needs to look at position increment and do the right thing.
Want to open a JIRA issue? On Mon, Mar 11, 2013 at 9:15 PM, 李威 <li...@antvision.cn> wrote: > in org.apache.solr.parser.SolrQueryParserBase, there is a function: > "protected Query newFieldQuery(Analyzer analyzer, String field, String > queryText, boolean quoted) throws SyntaxError" > > The below code can't process chinese rightly. > > " BooleanClause.Occur occur = positionCount > 1 && operator == > AND_OPERATOR ? > BooleanClause.Occur.MUST : BooleanClause.Occur.SHOULD; > > " > > For example, “北京市" and “北京" are synonym, if I seach "北京市动物园", the expected > parse result is "+(北京市 北京) +动物园", but actually it would be parsed to "+北京市 > +北京 +动物园". > > The code can process English, because English word is seperate by space, and > only one position. > > In order to process Chinese, I think it can charge by position increment, but > not by position count. > > Could you help take a look? > > > > > Thanks, > > Wei Li