2018-12-13 14:47:20 -05:00
---
2019-08-21 00:48:59 -04:00
id: searchqueryspec
title: "Refining search queries"
2018-12-13 14:47:20 -05:00
---
2018-11-13 12:38:37 -05:00
<!--
~ Licensed to the Apache Software Foundation (ASF) under one
~ or more contributor license agreements. See the NOTICE file
~ distributed with this work for additional information
~ regarding copyright ownership. The ASF licenses this file
~ to you under the Apache License, Version 2.0 (the
~ "License"); you may not use this file except in compliance
~ with the License. You may obtain a copy of the License at
~
~ http://www.apache.org/licenses/LICENSE-2.0
~
~ Unless required by applicable law or agreed to in writing,
~ software distributed under the License is distributed on an
~ "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
~ KIND, either express or implied. See the License for the
~ specific language governing permissions and limitations
~ under the License.
-->
2018-12-12 23:42:12 -05:00
2015-05-05 17:07:32 -04:00
Search query specs define how a "match" is defined between a search value and a dimension value. The available search query specs are:
InsensitiveContainsSearchQuerySpec
----------------------------------
If any part of a dimension value contains the value specified in this search query spec, regardless of case, a "match" occurs. The grammar is:
```json
{
"type" : "insensitive_contains",
"value" : "some_value"
}
```
FragmentSearchQuerySpec
-----------------------
2015-11-02 00:21:29 -05:00
If any part of a dimension value contains all of the values specified in this search query spec, regardless of case by default, a "match" occurs. The grammar is:
2015-05-05 17:07:32 -04:00
```json
2019-08-21 00:48:59 -04:00
{
2015-05-05 17:07:32 -04:00
"type" : "fragment",
2015-11-02 00:21:29 -05:00
"case_sensitive" : false,
2015-05-05 17:07:32 -04:00
"values" : ["fragment1", "fragment2"]
}
```
2015-11-02 00:21:29 -05:00
ContainsSearchQuerySpec
----------------------------------
If any part of a dimension value contains the value specified in this search query spec, a "match" occurs. The grammar is:
```json
{
"type" : "contains",
"case_sensitive" : true,
"value" : "some_value"
}
2015-11-23 16:38:29 -05:00
```
RegexSearchQuerySpec
----------------------------------
If any part of a dimension value contains the pattern specified in this search query spec, a "match" occurs. The grammar is:
```json
{
"type" : "regex",
"pattern" : "some_pattern"
}
2018-11-13 12:38:37 -05:00
```