lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Michael McCandless (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (LUCENE-5791) QueryParserUtil, big query with wildcards -> runs endlessly and produces heavy load
Date Sat, 28 Jun 2014 10:54:24 GMT

    [ https://issues.apache.org/jira/browse/LUCENE-5791?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14046806#comment-14046806
] 

Michael McCandless commented on LUCENE-5791:
--------------------------------------------

Ahh so this is indeed because of the determinize in Automaton.  Unfortunately, determinize
has worst-case exponential complexity, and I think this example in fact hits the worst case.
 I'm attaching the determinized automaton for abc*mno*xyz*pqr*def ... you can see it gets
larger and larger as you add parts between the *

> QueryParserUtil, big query with wildcards -> runs endlessly and produces heavy load
> -----------------------------------------------------------------------------------
>
>                 Key: LUCENE-5791
>                 URL: https://issues.apache.org/jira/browse/LUCENE-5791
>             Project: Lucene - Core
>          Issue Type: Bug
>          Components: modules/queryparser
>         Environment: Lucene 4.7.2
> Java 6
>            Reporter: Clemens Wyss
>         Attachments: afterdet.png
>
>
> The following "testcase" runs endlessly and produces VERY heavy load.
> ...
> String query = "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy
eirmod tempor invidunt ut "
> 				+ "labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
et justo duo dolores et "
> 				+ "ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum dolor
sit amet. "
> 				+ "Lorem ipsum dolor sit amet, consetetur sadipscing elitr, sed diam nonumy eirmod
tempor invidunt "
> 				+ "ut labore et dolore magna aliquyam erat, sed diam voluptua. At vero eos et accusam
et justo duo dolores "
> 				+ "et ea rebum. Stet clita kasd gubergren, no sea takimata sanctus est Lorem ipsum
dolor sit amet"; String query  = query.replaceAll( "\\s+", "*" ); try { QueryParserUtil.parse(
query, new String[] { "test" }, new Occur[] { Occur.MUST }, new KeywordAnalyzer() ); } catch
( Exception e ) { Assert.fail( e.getMessage() ); } ...
> I don't say this testcase makes "sense", nevertheless the question remains whether this
is a bug or a "feature"?
> 99% the threaddump/stacktrace looks as follows:
> BasicOperations.determinize(Automaton) line: 680	
> Automaton.determinize() line: 759	
> SpecialOperations.getCommonSuffixBytesRef(Automaton) line: 165	
> CompiledAutomaton.<init>(Automaton, Boolean, boolean) line: 168	
> CompiledAutomaton.<init>(Automaton) line: 91	
> WildcardQuery(AutomatonQuery).<init>(Term, Automaton) line: 67	
> WildcardQuery.<init>(Term) line: 57	
> WildcardQueryNodeBuilder.build(QueryNode) line: 42	
> WildcardQueryNodeBuilder.build(QueryNode) line: 32	
> StandardQueryTreeBuilder(QueryTreeBuilder).processNode(QueryNode, QueryBuilder) line:
186	
> StandardQueryTreeBuilder(QueryTreeBuilder).process(QueryNode) line: 125	
> StandardQueryTreeBuilder(QueryTreeBuilder).build(QueryNode) line: 218	
> StandardQueryTreeBuilder.build(QueryNode) line: 82	
> StandardQueryTreeBuilder.build(QueryNode) line: 53	
> StandardQueryParser(QueryParserHelper).parse(String, String) line: 258	
> StandardQueryParser.parse(String, String) line: 168	
> QueryParserUtil.parse(String, String[], BooleanClause$Occur[], Analyzer) line: 119	
> IndexingTest.queryParserUtilLimit() line: 1450	



--
This message was sent by Atlassian JIRA
(v6.2#6252)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message