Can't chain match_phrase_prefix in ElasticSearch - elasticsearch

I am trying to chain more than one match_phrase_prefix queries, but
for some reason it doesn't return any results (also no errors). When i try just
one match_phrase_prefix everything works just fine. I am using Elastic Search version 2.3 and my query looks like this:
"query": {
"bool": {
"must": [
{
"match_phrase_prefix": {
"title": "נפ"
}
},
{
"match_phrase_prefix": {
"sub_title": "נפצ"
}
}
]
}
}
my mapping for the specific index is:
{
"wcm_articles": {
"mappings": {
"article": {
"properties": {
"approved_talkbacks_counter": {
"type": "integer"
},
"article_link": {
"type": "string",
"index": "not_analyzed"
},
"author": {
"type": "string",
"analyzer": "hebrew"
},
"category_id": {
"type": "string",
"index": "not_analyzed"
},
"date_updated": {
"type": "date",
"format": "date_hour_minute_second"
},
"is_old": {
"type": "boolean"
},
"is_promoted": {
"type": "boolean"
},
"is_video": {
"type": "boolean"
},
"last_update_user": {
"type": "string",
"index": "not_analyzed"
},
"launch_date": {
"type": "date",
"format": "date_hour_minute_second"
},
"plain_text": {
"type": "string",
"analyzer": "hebrew"
},
"promotion_notes": {
"type": "string",
"index": "not_analyzed"
},
"status": {
"type": "string",
"index": "not_analyzed"
},
"sub_title": {
"type": "string",
"analyzer": "hebrew"
},
"tags": {
"type": "string",
"index": "not_analyzed"
},
"title": {
"type": "string",
"analyzer": "hebrew"
},
"type": {
"type": "string",
"index": "not_analyzed"
},
"waiting_talkbacks_counter": {
"type": "integer"
}
}
}
}
}
}
And some example documents are:
"_index": "wcm_articles",
"_type": "article",
"_id": "2828280",
"_score": 2.5246792,
"_source": {
"tags": [],
"category_id": 3,
"sub_title": "",
"promotion_notes": "",
"is_old": false,
"last_update_user": "",
"status": 1,
"type": "article",
"plain_text": "",
"launch_date": null,
"waiting_talkbacks_counter": 0,
"approved_talkbacks_counter": 0,
"is_video": false,
"article_link": "",
"date_updated": "2016-12-05T15:12:10",
"title": "קשישה כבת 80 נפצעה קשה מפגיעת רכב בחולון ",
"author": "",
"is_promoted": false
"_index": "wcm_articles",
"_type": "article",
"_id": "2829275",
"_score": 2.1283152,
"_source": {
"tags": [],
"category_id": 3,
"sub_title": "",
"promotion_notes": "",
"is_old": false,
"last_update_user": "",
"status": 1,
"type": "article",
"plain_text": "",
"launch_date": null,
"waiting_talkbacks_counter": 0,
"approved_talkbacks_counter": 0,
"is_video": false,
"article_link": "",
"date_updated": "2016-12-05T15:12:16",
"title": "רוכבת אופנוע נפצעה קשה בתאונת דרכים בצומת סירקין בפ\"ת",
"author": "",
"is_promoted": false

OK my issue is solved. There was no problem with chaining the queries. I was not using "match_phrase_prefix" the correct way, it wont work with a single word, only when you use it with more than one word, for a single word the correct query for the purpose of a form of autocomplete search (a search that includes a part of a word and not a whole word) is - "prefix". when chaining any combination of these two and used correctly for each - there is no problem at all.
Hope this helps someone else with a similar problem.

Related

combine filters using match_phrase - Elastic 1.7

Im using ES 1.7, trying to look for documents using match_phrase to search using exact match string. The filter works fine when used alone, however when I combine the filters, I get an error.
example: people document
q=aaron&address=scarborough - searching a person by name and address, works fine.
{
"query": {
"match_phrase": {
"name": "aaron"
}
},
"filter": {
"bool": {
"must": {
"nested": {
"path": "addresses",
"query": {
"match_phrase": {
"address": "scarborough"
}
}
}
}
}
},
q=aaron&phone=813-689-6889 - searching a person by name and phone number works fine as well.
{
"query": {
"match_phrase": {
"name": "aaron"
}
},
"filter": {
"bool": {
"must": {
"query": {
"match_phrase": {
"phone": "813-689-6889"
}
}
}
}
}
However, When I try to use both filters, address and phone I get a No filter registered for [match_phrase] error
for example: q=aaron&address=scarborough&phone=813-689-6889
{
"query": {
"match_phrase": {
"name": "aaron"
}
},
"filter": {
"bool": {
"must": {
"nested": {
"path": "addresses",
"query": {
"match_phrase": {
"address": "scarborough"
}
}
},
"query": {
"match_phrase": {
"phone": "813-689-6889"
}
}
}
}
}
the error, when using address and phone filters together:
nested: QueryParsingException[[pl_people] No filter registered for [match_phrase]]; }]","status":400}):
index mapping (person):
{
"pl_people": {
"mappings": {
"person": {
"properties": {
"ac_name": {
"type": "string",
"analyzer": "autocomplete"
},
"addresses": {
"type": "nested",
"properties": {
"address": {
"type": "string"
},
"city": {
"type": "string",
"index": "not_analyzed"
},
"city_id": {
"type": "long"
},
"country": {
"type": "string",
"index": "not_analyzed"
},
"county": {
"type": "string",
"index": "not_analyzed"
},
"county_id": {
"type": "long"
},
"id": {
"type": "long"
},
"location": {
"type": "geo_point"
},
"parameterized": {
"type": "string"
},
"state": {
"type": "string",
"index": "not_analyzed"
},
"state_id": {
"type": "long"
},
"zip": {
"type": "string",
"index": "not_analyzed"
}
}
},
"author": {
"type": "string",
"index": "not_analyzed"
},
"body": {
"type": "string",
"analyzer": "remove_html",
"fields": {
"ns_body": {
"type": "string",
"analyzer": "remove_html_stopwords"
}
}
},
"charities": {
"type": "nested",
"properties": {
"email": {
"type": "string",
"index": "not_analyzed"
},
"id": {
"type": "long"
}
}
},
"community": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
},
"slug": {
"type": "string",
"index": "not_analyzed"
}
}
},
"created_at": {
"type": "date",
"format": "dateOptionalTime"
},
"date_of_birth": {
"type": "date",
"format": "dateOptionalTime"
},
"delimiters": {
"type": "nested",
"properties": {
"delimiter_type": {
"type": "string",
"index": "not_analyzed"
},
"id": {
"type": "long"
}
}
},
"description": {
"type": "string"
},
"employments": {
"type": "nested",
"properties": {
"email": {
"type": "string",
"index": "not_analyzed"
},
"employment_status": {
"type": "string",
"index": "not_analyzed"
},
"foia_contact": {
"type": "boolean"
},
"id": {
"type": "long"
},
"phone": {
"type": "string",
"index": "not_analyzed"
},
"phone_extension": {
"type": "string",
"index": "not_analyzed"
}
}
},
"first_name": {
"type": "string",
"fields": {
"na_first_name": {
"type": "string",
"index": "not_analyzed"
}
}
},
"last_name": {
"type": "string",
"fields": {
"na_last_name": {
"type": "string",
"index": "not_analyzed"
}
}
},
"market": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
},
"slug": {
"type": "string",
"index": "not_analyzed"
}
}
},
"middle_name": {
"type": "string",
"fields": {
"na_middle_name": {
"type": "string",
"index": "not_analyzed"
}
}
},
"most_recent_organization": {
"properties": {
"description": {
"type": "string"
},
"id": {
"type": "long"
},
"name": {
"type": "string"
},
"parameterized": {
"type": "string"
},
"phone": {
"type": "string"
}
}
},
"name": {
"type": "string",
"fields": {
"na_name": {
"type": "string",
"index": "not_analyzed"
},
"ngram_name": {
"type": "string",
"analyzer": "my_start"
},
"ns_name": {
"type": "string",
"analyzer": "no_stopwords"
}
}
},
"organizations": {
"properties": {
"name": {
"type": "string"
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
}
}
},
"package": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
},
"slug": {
"type": "string",
"index": "not_analyzed"
}
}
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
},
"phone": {
"type": "string"
},
"photo": {
"properties": {
"large": {
"type": "string"
},
"medium": {
"type": "string"
},
"teaser": {
"type": "string"
},
"thumb": {
"type": "string"
},
"url": {
"type": "string"
}
}
},
"projects": {
"properties": {
"id": {
"type": "long"
},
"name": {
"type": "string",
"index": "not_analyzed"
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
},
"slug": {
"type": "string",
"index": "not_analyzed"
}
}
},
"public_offices": {
"type": "nested",
"properties": {
"email": {
"type": "string",
"index": "not_analyzed"
},
"employment_status": {
"type": "string",
"index": "not_analyzed"
},
"id": {
"type": "long"
}
}
},
"published": {
"type": "string",
"index": "not_analyzed"
},
"region": {
"properties": {
"name": {
"type": "string",
"index": "not_analyzed"
},
"parameterized": {
"type": "string",
"index": "not_analyzed"
},
"slug": {
"type": "string",
"index": "not_analyzed"
}
}
},
"resource": {
"type": "string"
},
"short_description": {
"type": "string"
},
"show_path": {
"type": "string"
},
"time": {
"type": "date",
"format": "dateOptionalTime"
},
"updated_at": {
"type": "date",
"format": "dateOptionalTime"
}
}
}
}
}
}
Document I am using to test
[
{
"_index": "pl_people",
"_type": "person",
"_id": "813106",
"_score": null,
"sort": [
-9223372036854775808
],
"resource": "Person",
"parameterized": "813106-aaron-mcguire",
"created_at": "2011-10-29T19:51:24.000-05:00",
"updated_at": "2014-12-11T07:21:08.000-06:00",
"name": "Aaron McGuire",
"title": null,
"photo": {
"url": "/assets/140x140.gif"
},
"description": null,
"short_description": null,
"time": "2014-12-11",
"show_path": "/people/813106-aaron-mcguire",
"published": true,
"aliases": [],
"phone": "813-689-6889",
"date_of_birth": "1991-03-01",
"first_name": "Aaron",
"middle_name": "",
"last_name": "McGuire",
"delimiters": [],
"market": null,
"region": null,
"most_recent_organization": null,
"households": [],
"court_cases": [],
"addresses": [
{
"id": 1,
"parameterized": "1",
"address": "123 Scarborough road",
"zip": "L5A2A9",
"city": "Ontario",
"country": "USA",
"state": "California",
"location": null,
"state_id": null,
"county_id": null,
"city_id": null
}
],
"projects": [],
"voter_ids": [],
"id": "813106"
}
]
Finally, I was able to reproduce the issue, Looks like "include_in_parent": true, missed in your mapping, due to which I was getting the error mentioned In my comment..
To fix, the issue I used the same mapping provided you but add "include_in_parent": true, at the top level of address nested field. For brevity providing only the address part of modified mapping.
"addresses": {
"type": "nested",
"include_in_parent": true, --> added only this in your mapping.
"properties": {
"address": {
"type": "string"
},
"city": {
"type": "string",
"index": "not_analyzed"
},
"city_id": {
"type": "long"
},
"country": {
"type": "string",
"index": "not_analyzed"
},
"county": {
"type": "string",
"index": "not_analyzed"
},
"county_id": {
"type": "long"
},
"id": {
"type": "long"
},
"location": {
"type": "geo_point"
},
"parameterized": {
"type": "string"
},
"state": {
"type": "string",
"index": "not_analyzed"
},
"state_id": {
"type": "long"
},
"zip": {
"type": "string",
"index": "not_analyzed"
}
}
}
After that indexed some sample docs, which have different values of address and name param, to verify the right outcome of my search query.
And final search query which includes both the filter, please note, I removed the nested part on address field as it's included at the parent document, so you can directly query now on it. This query looks much simple and now gives the expected result.
{
"query": {
"match_phrase": {
"name": "aaron"
}
},
"filter": {
"bool": {
"must": [{
"query": {
"match_phrase": {
"address": "scarborough"
}
}
},
{
"query": {
"match_phrase": {
"phone": "813-689-6889"
}
}
}]
}
}
}
Output on sample docs
"hits": [
{
"_index": "so-match-phrase",
"_type": "pl_people",
"_id": "4",
"_score": 0.19178301,
"_source": {
"resource": "Person",
"parameterized": "813106-aaron-mcguire",
"created_at": "2011-10-29T19:51:24.000-05:00",
"updated_at": "2014-12-11T07:21:08.000-06:00",
"name": "aaron McGuire",
"title": null,
"photo": {
"url": "/assets/140x140.gif"
},
"description": null,
"short_description": null,
"time": "2014-12-11",
"show_path": "/people/813106-aaron-mcguire",
"published": true,
"aliases": [],
"phone": "813-689-6889",
"date_of_birth": "1991-03-01",
"first_name": "Aaron",
"middle_name": "",
"last_name": "McGuire",
"delimiters": [],
"market": null,
"region": null,
"most_recent_organization": null,
"households": [],
"court_cases": [],
"addresses": [
{
"id": 1,
"parameterized": "1",
"address": "Scarborough road",
"zip": "L5A2A9",
"city": "Ontario",
"country": "USA",
"state": "California",
"location": null,
"state_id": null,
"county_id": null,
"city_id": null
}
],
"id": "813106"
}
},
{
"_index": "so-match-phrase",
"_type": "pl_people",
"_id": "1",
"_score": 0.19178301,
"_source": {
"resource": "Person",
"parameterized": "813106-aaron-mcguire",
"created_at": "2011-10-29T19:51:24.000-05:00",
"updated_at": "2014-12-11T07:21:08.000-06:00",
"name": "Aaron McGuire",
"title": null,
"photo": {
"url": "/assets/140x140.gif"
},
"description": null,
"short_description": null,
"time": "2014-12-11",
"show_path": "/people/813106-aaron-mcguire",
"published": true,
"aliases": [],
"phone": "813-689-6889",
"date_of_birth": "1991-03-01",
"first_name": "Aaron",
"middle_name": "",
"last_name": "McGuire",
"delimiters": [],
"market": null,
"region": null,
"most_recent_organization": null,
"households": [],
"court_cases": [],
"addresses": [
{
"id": 1,
"parameterized": "1",
"address": "123 Scarborough road",
"zip": "L5A2A9",
"city": "Ontario",
"country": "USA",
"state": "California",
"location": null,
"state_id": null,
"county_id": null,
"city_id": null
}
],
"id": "813106"
}
}
]

elasticsearch exceeds memory after few hours

In our system, 5000-15000 records written to elasticsearch(1.7.3) per minute, for first 4-5 hours its fine but after then it starts slowing down and almost no response any read or write request. After we restart elastic service its works fine for 4-5 hours again..
When elasticsearch starts slowing I checked the memory its about %95 so I think this is the reason why its broken but I dont understand why its loading RAM and never flush it.. No point of increasing ram, We have 8 GB RAM and elastic reached %95 of it in 5 hours..
Is there anything handle this? flush memory or auto restart elastic etc. ?
EDITED
Here is sample document in index:
"hits": {
"total": 18083446,
"max_score": 1,
"hits": [
{
"_index": "userlogs",
"_type": "userlogstype",
"_id": "AVMZEEYwW1W7iq27fTcE",
"_score": 1,
"_source": {
"domain": "http://gatr.hit.gemius.pl/",
"url": "http://gatr.hit.gemius.pl/_1456414408406/rexdot.js?",
"filetype": "-",
"clientname": "NOTINDOMAIN",
"clientmac": "00:0c:29:8f:c4:4f",
"hierarchycode": "HIER_DIRECT/188.165.145.88",
"user": "-",
"duration": "168",
"respsize": "1059",
"clientip": "10.6.1.130",
"loggingdate": "25/02/2016 17:33:28",
"resultcode": "TCP_MISS/301",
"reqmethod": "GET"
}
},
{
"_index": "userlogs",
"_type": "userlogstype",
"_id": "AVMZEEYwW1W7iq27fTcI",
"_score": 1,
"_source": {
"domain": "http://10.6.2.212/",
and here is mapping of index:
{
"webproxylog": {
"mappings": {
"update_by_query": {
"properties": {
"query": {
"properties": {
"filtered": {
"properties": {
"filter": {
"properties": {
"term": {
"properties": {
"url": {
"type": "string"
}
}
}
}
}
}
}
}
},
"script": {
"type": "string"
}
}
},
"accesslog": {
"properties": {
"action": {
"type": "string",
"index": "not_analyzed"
},
"action4cat": {
"type": "string",
"index": "not_analyzed"
},
"category": {
"type": "string"
},
"clientip": {
"type": "string",
"index": "not_analyzed"
},
"clientmac": {
"type": "string",
"index": "not_analyzed"
},
"clientname": {
"type": "string",
"index": "not_analyzed"
},
"domain": {
"type": "string",
"index": "not_analyzed"
},
"duration": {
"type": "long"
},
"filetype": {
"type": "string",
"index": "not_analyzed"
},
"hierarchycode": {
"type": "string",
"index": "not_analyzed"
},
"index": {
"properties": {
"_index": {
"type": "string"
},
"_type": {
"type": "string"
}
}
},
"loggingdate": {
"type": "date",
"format": "dd/MM/yyyy HH:mm:ss"
},
"reqmethod": {
"type": "string",
"index": "not_analyzed"
},
"respsize": {
"type": "long"
},
"resultcode": {
"type": "string",
"index": "not_analyzed"
},
"url": {
"type": "string",
"index": "not_analyzed"
},
"user": {
"type": "string",
"index": "not_analyzed"
}
}
}
}
}
}
query sample :
{
"size": 0,
"query": {
"filtered": {
"filter": {
"bool": {
"must": [
{
"exists": {
"field": "instock"
}
},
{}
]
}
}
}
},
"aggs": {
"aggs1": {
"terms": {
"field": "clientname",
"size": 5,
"order": {
"aggs2": "desc"
}
},
"aggs": {
"aggs2": {
"sum": {
"field": "respsize"
}
}
}
}
}
}

ElasticSearch _suggest not returning results

I have an index that I'd like to get suggestions on:
{
"book": {
"_index": {
"enabled": true
},
"_id": {
"index": "not_analyzed",
"store": "yes"
},
"properties": {
"author": {
"type": "completion"
},
"characters": {
"type": "string"
},
"copies": {
"type": "long",
"ignore_malformed": false
},
"otitle": {
"type": "string"
},
"tags": {
"type": "string"
},
"title": {
"type": "string"
},
"year": {
"type": "long",
"ignore_malformed": false,
"index": "analyzed"
},
"available": {
"type": "boolean"
}
}
}
}
I've loaded some data into it using _bulk endpoint.
When I try to query against the suggest endpoint:
POST library/book/_suggest
{
"my_suggestion_1":{
"text": "He",
"term":{
"analyzer":"standard",
"field":"author"
}
}
}
I get back this:
{
"_index": "library",
"_type": "book",
"_id": "_suggest",
"_version": 8,
"created": false
}
What am I missing here?
I think you just need to use completion instead of term in your request body when you ask for suggestions:
POST library/book/_suggest
{
"my_suggestion_1":{
"text": "He",
"completion":{
"analyzer":"standard",
"field":"author"
}
}
}

elasticsearch : object mapping and getting data from database

I use elasticsearch and oracle for the database.
Database :
I create a view with all the data I need to index. I have 1-N relations between my "occurences" table and "determinations" table and between "occurrences" table and "multimedias" table so one occurrence have multiples determinations and multimedias.
Elasticsearch :
I create a mapping and the river to get data from the database view.
the problem is I need an array of object for multimedias and determinations instead of an array for each fields in elasticsearch result ( example below ).
mapping
curl -XPUT 'localhost:9200/botanic/' -d '{
"settings": {
"index": {
"analysis": {
"analyzer": {
"keylower": {
"tokenizer": "keyword",
"filter": "lowercase"
}
}
}
}
},
"mappings": {
"specimens": {
"_all": {
"enabled": true
},
"_index": {
"enabled": true
},
"_id": {
"index": "not_analyzed",
"store": false
},
"properties": {
"_id": {
"type": "string",
"store": "no",
"index": "not_analyzed"
},
...
"MULTIMEDIA": {
"_id": {
"path": "M_MULTIMEDIAID"
},
"type": "object",
"properties": {
"M_MULTIMEDIAID": {
"type": "string",
"store": "yes",
"index": "not_analyzed"
},
"M_CREATOR": {
"type": "string",
"store": "yes",
"index": "not_analyzed"
},
"M_DESCRIPTION": {
"type": "string",
"store": "yes",
"index": "analyzed"
}
...
}
},
"DETERMINATIONS": {
"_id": {
"path": "D_OCCURRENCEID"
},
"type": "object",
"properties": {
"D_OCCURRENCEID": {
"type": "string",
"store": "yes",
"index": "not_analyzed"
},
"D_DETERMINATIONID": {
"type": "string",
"store": "yes",
"index": "not_analyzed"
},
"D_DATEIDENTIFIED": {
"type": "string",
"store": "yes",
"index": "analyzed"
},
"D_TYPESTATUS": {
"type": "string",
"store": "yes",
"index": "analyzed"
},
"D_CREATED": {
"type": "date",
"store": "yes",
"index": "analyzed"
}
}
},
...
"I_INSTITUTIONID": {
"type": "string",
"store": "yes",
"index": "not_analyzed"
},
"I_INSTITUTIONCODE": {
"type": "string",
"store": "yes",
"index": "analyzed"
}
}
}
}
}'
the river
curl -XPUT 'localhost:9200/_river/botanic_river/_meta' -d '{
"type": "jdbc",
"jdbc": {
"index": "botanic",
"type": "specimens",
"url": "jdbc:oracle:thin:#localhost:1523:database",
"user": "user",
"password": "password",
"sql": "select * from elasticsearchview"
}
}'
the result I get ( multiple fields and for each an array ):
"hits": [
{
"_index": "botanic",
"_type": "specimens",
"_id": "345F5BEA7FDB4B17A7831514E25CD29B",
"_score": 0.4430604,
"_source": {
...
"M_MULTIMEDIAID": [
"0E91818D48DE40C785733F9F3A7932F1",
"833C6E79D7844D568B828DF2D8BA8AC7",
"F76F6766398042D38902DA9165D41514"
],
"M_CREATOR": [
"creator1",
"creator2",
"creator3"
],
"M_DESCRIPTION": [
"descr1",
"descr3",
"descr2"
],
...
}
}
]
but I need something like this ( array of object ) :
"hits": [
{
"_index": "botanic",
"_type": "specimens",
"_id": "345F5BEA7FDB4B17A7831514E25CD29B",
"_score": 0.4430604,
"_source": {
...
"MULTIMEDIA": [
{
"M_MULTIMEDIAID": "0E91818D48DE40C785733F9F3A7932F1",
"M_CREATOR": "creator1",
"M_DESCRIPTION": "descr1"
},
{
"M_MULTIMEDIAID": "833C6E79D7844D568B828DF2D8BA8AC7",
"M_CREATOR": "creator2",
"M_DESCRIPTION": "descr2"
},
{
"M_MULTIMEDIAID": "F76F6766398042D38902DA9165D41514",
"M_CREATOR": "creator3",
"M_DESCRIPTION": "descr3"
}
]
...
}
}
]
I tried "type" : "object" and "type" : "nested" in the mapping but same result.
how can do this ?

Elastic Search queries not working with curl

Running the command:
curl -XGET http://127.0.0.1:9200/30556/_search -d '{
"query": {
"constant_score" : {
"filter" : {
"term" : { "portal_type" : "Folder"}
}
}
}
}'
yields 0 results. The output is:
{"took":1,"timed_out":false,"_shards":{"total":5,"successful":5,"failed":0},"hits":{"total":0,"max_score":null,"hits":[]}}
If fact, I can't get any queries to yield results.
However, when I run the same query using the head plugin, it works fine.
I'm on elasticsearch 0.20.2 on Mac OS X. I'm starting elastic search using the command:
bin/elasticsearch -f
Is there something obvious I'm missing? Seems like I have the correct syntax and I don't get any errors.
Mapping:
{
"30556": {
"portal_catalog": {
"properties": {
"CreationDate": {
"type": "date",
"format": "dateOptionalTime"
},
"Creator": {
"type": "string"
},
"Date": {
"type": "date",
"format": "dateOptionalTime"
},
"Description": {
"type": "string"
},
"ModificationDate": {
"type": "date",
"format": "dateOptionalTime"
},
"SearchableText": {
"type": "string"
},
"Title": {
"type": "string"
},
"Type": {
"type": "string"
},
"UID": {
"type": "string"
},
"allowedRolesAndUsers": {
"type": "string"
},
"created": {
"type": "date",
"format": "dateOptionalTime"
},
"effective": {
"type": "date",
"format": "dateOptionalTime"
},
"effectiveRange": {
"dynamic": "true",
"properties": {
"effectiveRange1": {
"type": "date",
"format": "dateOptionalTime"
},
"effectiveRange2": {
"type": "date",
"format": "dateOptionalTime"
}
}
},
"exclude_from_nav": {
"type": "boolean"
},
"expires": {
"type": "date",
"format": "dateOptionalTime"
},
"getId": {
"type": "string"
},
"getObjPositionInParent": {
"type": "long"
},
"getObjSize": {
"type": "string"
},
"id": {
"type": "string"
},
"is_default_page": {
"type": "boolean"
},
"is_folderish": {
"type": "boolean"
},
"listCreators": {
"type": "string"
},
"meta_type": {
"type": "string"
},
"modified": {
"type": "date",
"format": "dateOptionalTime"
},
"object_provides": {
"type": "string"
},
"path": {
"dynamic": "true",
"properties": {
"depth": {
"type": "long"
},
"path": {
"type": "string"
}
}
},
"portal_type": {
"type": "string"
},
"review_state": {
"type": "string"
},
"sortable_title": {
"type": "string"
},
"total_comments": {
"type": "long"
}
}
}
}
}
Example Indexed Document:
{
"_index": "30556",
"_type": "portal_catalog",
"_id": "30613",
"_score": 1,
"_source": {
"sortable_title": "news",
"exclude_from_nav": false,
"meta_type": "ATFolder",
"Date": "2013-01-14T09:24:56-06:00",
"CreationDate": "2013-01-14T09:24:56-06:00",
"path": {
"depth": 2,
"path": "/el/news"
},
"allowedRolesAndUsers": [
"Anonymous"
],
"portal_type": "Folder",
"id": "news",
"UID": "3116b6c7ec384a9393f238fdde778612",
"expires": "2499-12-31T00:00:00-06:00",
"Subject": [],
"is_folderish": true,
"is_default_page": false,
"effectiveRange": {
"effectiveRange1": "1000-01-01T00:00:00-06:00",
"effectiveRange2": "2499-12-31T00:00:00-06:00"
},
"commentators": [],
"created": "2013-01-14T09:24:56-06:00",
"getRawRelatedItems": [],
"cmf_uid": [],
"Creator": "admin",
"end": [],
"modified": "2013-01-14T09:24:56-06:00",
"Description": "Site News",
"ModificationDate": "2013-01-14T09:24:56-06:00",
"total_comments": 0,
"in_reply_to": [],
"getIcon": "",
"effective": "1000-01-01T00:00:00-06:00",
"SearchableText": "news News Site News ",
"getObjPositionInParent": 61,
"object_provides": [
"collective.syndication.interfaces.ISyndicatable",
"Products.ATContentTypes.interfaces.folder.IATFolder",
"Products.CMFCore.interfaces._content.IContentish",
"z3c.relationfield.interfaces.IHasIncomingRelations",
"webdav.interfaces.IWriteLock"
],
"last_comment_date": null,
"review_state": "published",
"start": [],
"Type": "Folder",
"listCreators": [
"admin"
],
"getId": "news",
"getObjSize": "1 kB",
"Title": "News"
}
Try to use lower case index names.
Does it work?
If not, can you provide your indexed document and mapping if any?
UPDATE:
You use default analyzer so your field is broken into tokens which are lowercased.
A TermFilter is not analyzed So it does not match.
You can lowercase you TermFilter or use a MatchQuery which is analyzed or change your mapping and set the field to not_analyzed.

Resources