Lines Matching refs:query

39  * Helper class that builds a Lucene query based on provided search terms for
62 * A map containing the query text for each field. (We use a sorted map here
63 * only because we have tests that check the generated query string. If we
72 * @param freetext query string to set
82 * @return {@code null} if not set, the query string otherwise.
91 * @param defs query string to set
101 * @return {@code null} if not set, the query string otherwise.
110 * @param refs query string to set
120 * @return {@code null} if not set, the query string otherwise.
129 * @param path query string to set
139 * @return {@code null} if not set, the query string otherwise.
148 * @param hist query string to set
158 * @return {@code null} if not set, the query string otherwise.
165 * Get a map containing the query text for each of the fields that have been
175 * Get the number of query fields set.
177 * @return the current number of fields with a none-empty query string.
184 * Build a new query based on the query text that has been passed in to this
187 * @return a query, or {@code null} if no query text is available.
188 * @throws ParseException if the query text cannot be parsed
195 // Parse each of the query texts separately
202 // If we only have one sub-query, return it directly
211 // the query as a whole. One exception to this rule: If the query
218 // query with Occur.MUST.
220 for (Query query : queryList) {
221 if (query instanceof BooleanQuery) {
222 BooleanQuery boolQuery = (BooleanQuery) query;
225 combinedQuery.add(query, Occur.MUST);
232 combinedQuery.add(query, Occur.MUST);
239 * Add query text for the specified field.
241 * @param field the field to add query text for
242 * @param query the query text to set
245 private QueryBuilder addQueryText(String field, String query) {
246 if (query == null || query.isEmpty()) {
249 queries.put(field, query);
259 * Escape special characters in a query string.
261 * @param field the field for which the query string is provided
262 * @param query the query string to escape
263 * @return the escaped query string
265 private String escapeQueryString(String field, String query) {
269 ? query.replace("::", "\\:\\:")
272 : query.replace(":", "\\:");
278 * @param field the field to build the query against
279 * @param queryText the query text
280 * @return a parsed query
281 * @throws ParseException if the query text cannot be parsed
291 * @param query the query to check
293 * @return whether or not the query contains a clause of the specified type
295 private boolean hasClause(BooleanQuery query, Occur occur) {
296 for (BooleanClause clause : query) {