|
static void | applySearchToQuery (String search, WhereClause wc, List< String > fields) |
|
static void | applySearchToQuery (String search, WhereClause wc, List< String > fields, boolean withSynonyms) |
|
static void | applySearchToQuery (String search, WhereClause wc, List< String > fields, boolean withSynonyms, boolean orEd) |
|
static void | applyFullsearchToQuery (String search, WhereClause wc, String fields) |
|
static void | applyFullsearchToQuery (String search, WhereClause wc, String fields, boolean withSynonyms) |
|
static void | applyFullsearchToQuery (String search, WhereClause wc, String fields, boolean withSynonyms, boolean orEd) |
|
- Author
- Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g
Definition at line 31 of file SQLUtil.java.
◆ applyFullsearchToQuery() [1/3]
static void org.turro.sql.SQLUtil.applyFullsearchToQuery |
( |
String |
search, |
|
|
WhereClause |
wc, |
|
|
String |
fields |
|
) |
| |
|
static |
Definition at line 69 of file SQLUtil.java.
static void applyFullsearchToQuery(String search, WhereClause wc, String fields)
◆ applyFullsearchToQuery() [2/3]
static void org.turro.sql.SQLUtil.applyFullsearchToQuery |
( |
String |
search, |
|
|
WhereClause |
wc, |
|
|
String |
fields, |
|
|
boolean |
withSynonyms |
|
) |
| |
|
static |
◆ applyFullsearchToQuery() [3/3]
static void org.turro.sql.SQLUtil.applyFullsearchToQuery |
( |
String |
search, |
|
|
WhereClause |
wc, |
|
|
String |
fields, |
|
|
boolean |
withSynonyms, |
|
|
boolean |
orEd |
|
) |
| |
|
static |
Definition at line 77 of file SQLUtil.java.
79 List<Synonyms> synonyms = Synonyms.getSynonymsByWords(search);
80 if(!synonyms.isEmpty() && synonyms.size() <=
MAX_SYNONIMS) {
81 for(Synonyms s : synonyms) {
82 for(String w : s.getWords()) {
83 if(!search.toLowerCase().contains(w.toLowerCase())) {
90 wc.addClause(orEd ?
"or (" :
"and (");
91 wc.addClause(
"match(" + fields +
") against (:fsearch01)");
92 wc.setOrderByClause(
"match(" + fields +
") against (:fsearch01) desc");
93 wc.addNamedValue(
"fsearch01", search);
95 wc.setUseNative(
true);
static final int MAX_SYNONIMS
◆ applySearchToQuery() [1/3]
static void org.turro.sql.SQLUtil.applySearchToQuery |
( |
String |
search, |
|
|
WhereClause |
wc, |
|
|
List< String > |
fields |
|
) |
| |
|
static |
Definition at line 36 of file SQLUtil.java.
static void applySearchToQuery(String search, WhereClause wc, List< String > fields)
◆ applySearchToQuery() [2/3]
static void org.turro.sql.SQLUtil.applySearchToQuery |
( |
String |
search, |
|
|
WhereClause |
wc, |
|
|
List< String > |
fields, |
|
|
boolean |
withSynonyms |
|
) |
| |
|
static |
◆ applySearchToQuery() [3/3]
static void org.turro.sql.SQLUtil.applySearchToQuery |
( |
String |
search, |
|
|
WhereClause |
wc, |
|
|
List< String > |
fields, |
|
|
boolean |
withSynonyms, |
|
|
boolean |
orEd |
|
) |
| |
|
static |
Definition at line 44 of file SQLUtil.java.
46 wc.addClause(orEd ?
"or (" :
"and (");
47 for(String field : fields) {
48 wc.addClause(sep + field +
" like :search01");
51 wc.addNamedValue(
"search01", SQLHelper.convertToPartialLike(search));
53 List<Synonyms> synonyms = Synonyms.getSynonymsByWords(search);
54 if(!synonyms.isEmpty() && synonyms.size() <=
MAX_SYNONIMS) {
55 for(Synonyms s : synonyms) {
56 for(String field : fields) {
57 for(String w : s.getWords()) {
58 wc.addClause(sep + field +
" like :w" + Strings.identifier(w));
60 wc.addNamedValue(
"w" + Strings.identifier(w), SQLHelper.convertToPartialLike(w));
◆ MAX_SYNONIMS
final int org.turro.sql.SQLUtil.MAX_SYNONIMS = 10 |
|
static |
The documentation for this class was generated from the following file: