Package org.nuxeo.ecm.core.storage
Class FulltextQueryAnalyzer
- java.lang.Object
-
- org.nuxeo.ecm.core.storage.FulltextQueryAnalyzer
-
public class FulltextQueryAnalyzer extends Object
Structured fulltext query analyzer.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classFulltextQueryAnalyzer.FulltextQueryStructured fulltext query.static classFulltextQueryAnalyzer.OpStructured fulltext query operator.
-
Field Summary
Fields Modifier and Type Field Description protected static charCSPACEprotected static StringDOUBLE_QUOTESprotected FulltextQueryAnalyzer.FulltextQueryftprotected static PatternIGNOREDprotected static StringMINUSprotected static StringORprotected static StringPLUSprotected static PatternSEPARATORprotected static StringSPACEprotected List<FulltextQueryAnalyzer.FulltextQuery>terms
-
Constructor Summary
Constructors Constructor Description FulltextQueryAnalyzer()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected FulltextQueryAnalyzer.FulltextQueryanalyze(String query)static FulltextQueryAnalyzer.FulltextQueryanalyzeFulltextQuery(String query)Analyzes a fulltext query into a generic datastructure that can be used for each specific database.protected static voidappendWord(String word, StringBuilder sb, String start, String end, Set<Character> reserved)protected voidendAnd()static booleanhasPhrase(FulltextQueryAnalyzer.FulltextQuery ft)protected booleanignored(String word)protected String[]split(String query)static voidtranslate(FulltextQueryAnalyzer.FulltextQuery ft, StringBuilder sb, String or, String and, String andNot, String wordStart, String wordEnd, Set<Character> wordCharsReserved, String phraseStart, String phraseEnd, boolean quotePhraseWords)static StringtranslateFulltext(FulltextQueryAnalyzer.FulltextQuery ft, String or, String and, String andNot, String phraseQuote)Translate fulltext into a common pattern used by many servers.static StringtranslateFulltext(FulltextQueryAnalyzer.FulltextQuery ft, String or, String and, String andNot, String wordStart, String wordEnd, Set<Character> wordCharsReserved, String phraseStart, String phraseEnd, boolean quotePhraseWords)Translate fulltext into a common pattern used by many servers.
-
-
-
Field Detail
-
SPACE
protected static final String SPACE
- See Also:
- Constant Field Values
-
PLUS
protected static final String PLUS
- See Also:
- Constant Field Values
-
MINUS
protected static final String MINUS
- See Also:
- Constant Field Values
-
CSPACE
protected static final char CSPACE
- See Also:
- Constant Field Values
-
DOUBLE_QUOTES
protected static final String DOUBLE_QUOTES
- See Also:
- Constant Field Values
-
OR
protected static final String OR
- See Also:
- Constant Field Values
-
SEPARATOR
protected static final Pattern SEPARATOR
-
IGNORED
protected static final Pattern IGNORED
-
ft
protected FulltextQueryAnalyzer.FulltextQuery ft
-
terms
protected List<FulltextQueryAnalyzer.FulltextQuery> terms
-
-
Method Detail
-
analyze
protected FulltextQueryAnalyzer.FulltextQuery analyze(String query)
-
ignored
protected boolean ignored(String word)
-
endAnd
protected void endAnd()
-
translate
public static void translate(FulltextQueryAnalyzer.FulltextQuery ft, StringBuilder sb, String or, String and, String andNot, String wordStart, String wordEnd, Set<Character> wordCharsReserved, String phraseStart, String phraseEnd, boolean quotePhraseWords)
-
appendWord
protected static void appendWord(String word, StringBuilder sb, String start, String end, Set<Character> reserved)
-
hasPhrase
public static boolean hasPhrase(FulltextQueryAnalyzer.FulltextQuery ft)
-
analyzeFulltextQuery
public static FulltextQueryAnalyzer.FulltextQuery analyzeFulltextQuery(String query)
Analyzes a fulltext query into a generic datastructure that can be used for each specific database.List of terms containing only negative words are suppressed. Otherwise negative words are put at the end of the lists of terms.
-
translateFulltext
public static String translateFulltext(FulltextQueryAnalyzer.FulltextQuery ft, String or, String and, String andNot, String phraseQuote)
Translate fulltext into a common pattern used by many servers.
-
translateFulltext
public static String translateFulltext(FulltextQueryAnalyzer.FulltextQuery ft, String or, String and, String andNot, String wordStart, String wordEnd, Set<Character> wordCharsReserved, String phraseStart, String phraseEnd, boolean quotePhraseWords)
Translate fulltext into a common pattern used by many servers.
-
-