Skip to content
Snippets Groups Projects
Commit 068f9501 authored by vkovtun's avatar vkovtun
Browse files

SSDM-9369 Working on determining the position of the matches inside the results.

parent a7017731
No related branches found
Tags ts_vector
No related merge requests found
......@@ -25,6 +25,15 @@ public class GlobalSearchCriteriaTranslator
public static final String IDENTIFIER_ALIAS = "identifier";
public static final String HEADLINE_ALIAS_SUFFIX = "_headline";
private static final String START_SEL = "<{(";
private static final String STOP_SEL = ")}>";
private static final String TS_HEADLINE_OPTIONS = "HighlightAll=TRUE, StartSel=" + START_SEL
+", StopSel=" + STOP_SEL;
private GlobalSearchCriteriaTranslator()
{
throw new UnsupportedOperationException();
......@@ -115,11 +124,16 @@ public class GlobalSearchCriteriaTranslator
sqlBuilder.append(TS_RANK).append(LP).append(MAIN_TABLE_ALIAS).append(PERIOD).append(TSVECTOR_DOCUMENT).append(COMMA).append(SP);
buildTsQueryPart(sqlBuilder, value, args);
sqlBuilder.append(RP).append(SP).append(RANK_ALIAS)/*.append(COMMA).append(SP)*/;
sqlBuilder.append(RP).append(SP).append(RANK_ALIAS).append(COMMA).append(SP);
// sqlBuilder.append(QU).append(SP).append(SEARCH_STRING_ALIAS).append(NL);
// args.add(value);
sqlBuilder.append(TS_HEADLINE).append(LP).append(MAIN_TABLE_ALIAS).append(PERIOD).append(CODE_COLUMN).append(COMMA).append(SP);
buildTsQueryPart(sqlBuilder, value, args);
sqlBuilder.append(COMMA).append(SP).append(SQ).append(TS_HEADLINE_OPTIONS).append(SQ).append(RP).append(SP)
.append(CODE_COLUMN).append(HEADLINE_ALIAS_SUFFIX);
sqlBuilder.append(NL);
// FROM
......
......@@ -31,6 +31,8 @@ public class SQLLexemes
public static final String TO_TSQUERY = "to_tsquery";
public static final String TS_HEADLINE = "ts_headline";
public static final String PLAINTO_TSQUERY = "plainto_tsquery";
public static final String NUMERIC = "numeric";
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment