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 class
FulltextQueryAnalyzer.FulltextQuery
Structured fulltext query.static class
FulltextQueryAnalyzer.Op
Structured fulltext query operator.
-
Field Summary
Fields Modifier and Type Field Description protected static char
CSPACE
protected static String
DOUBLE_QUOTES
protected FulltextQueryAnalyzer.FulltextQuery
ft
protected static Pattern
IGNORED
protected static String
MINUS
protected static String
OR
protected static String
PLUS
protected static Pattern
SEPARATOR
protected static String
SPACE
protected 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.FulltextQuery
analyze(String query)
static FulltextQueryAnalyzer.FulltextQuery
analyzeFulltextQuery(String query)
Analyzes a fulltext query into a generic datastructure that can be used for each specific database.protected static void
appendWord(String word, StringBuilder sb, String start, String end, Set<Character> reserved)
protected void
endAnd()
static boolean
hasPhrase(FulltextQueryAnalyzer.FulltextQuery ft)
protected boolean
ignored(String word)
protected String[]
split(String query)
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)
static String
translateFulltext(FulltextQueryAnalyzer.FulltextQuery ft, String or, String and, String andNot, String phraseQuote)
Translate fulltext into a common pattern used by many servers.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.
-
-
-
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.
-
-