# Failed to search given search data using elastic java api?

**URL:** <https://discuss.elastic.co/t/failed-to-search-given-search-data-using-elastic-java-api/5133>\
**Category:** Elasticsearch\
**Created:** [August 12, 2011, 7:16am UTC](https://discuss.elastic.co/t/failed-to-search-given-search-data-using-elastic-java-api/5133 "2011-08-12T07:16:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sam\_4](https://avatars.discourse-cdn.com/v4/letter/s/db5fbb/32.png) [@Sam\_4](https://discuss.elastic.co/u/Sam_4)\
**Post date:** [August 12, 2011, 7:16am UTC](https://discuss.elastic.co/t/failed-to-search-given-search-data-using-elastic-java-api/5133/1 "2011-08-12T07:16:23Z")

</div>

Hi

I'm using elastic search-0.16.2 server.my search string "09Q2 SR  
Website Whitepaper: TrustedSource: The Next Generation Reputation  
System for".i got following error:

Caused by:  
org.elasticsearch.transport.NotSerializableTransportException:  
[org.elasticsearch.search.SearchParseException] [114648][2]:  
from[-1],size[-1]: Parse Failure [Failed to parse source [🙂  
??ery??ery\_string??9Q2 SR Website Whitepaper: TrustedSource: The  
Next Generation Reputation System for??elds?countName??]]; [114648]  
Failed to parse query [09Q2 SR Website Whitepaper: TrustedSource: The  
Next Generation Reputation System for]; Cannot parse '09Q2 SR Website  
Whitepaper: TrustedSource: The Next Generation Reputation System  
for': Encountered " ":" ": "" at line 1, column 42.  
Was expecting one of:  
  
 ...  
 ...  
 ...  
"+" ...  
"-" ...  
"(" ...  
"_" ...  
"^" ...  
 ...  
 ...  
\<FUZZY\_SLOP\> ...  
 ...  
 ...  
"[" ...  
"{" ...  
 ...  
; Encountered " ":" ": "" at line 1, column 42.  
Was expecting one of:_  
   
 _...  
 ...  
 ...  
"+" ...  
"-" ...  
"(" ...  
"_" ...  
"^" ...  
 ...  
 ...  
\<FUZZY\_SLOP\> ...  
 ...  
 ...  
"[" ...  
"{" ...  
 ...  
;  
DEBUG - [Dracula] [114648][3], node[GzlwvpEgRQGpSjJuDErklQ], [P],  
s[STARTED]: Failed to execute  
[org.elasticsearch.action.search.SearchRequest@cfb11f]  
org.elasticsearch.transport.RemoteTransportException: [Corruptor]  
[inet[/192.168.1.100:9302]][search/phase/query]  
Caused by:  
org.elasticsearch.transport.NotSerializableTransportException:  
[org.elasticsearch.search.SearchParseException] [114648][3]:  
from[-1],size[-1]: Parse Failure [Failed to parse source [🙂  
??ery??ery\_string??9Q2 SR Website Whitepaper: TrustedSource: The  
Next Generation Reputation System for??elds?countName??]]; [114648]  
Failed to parse query [09Q2 SR Website Whitepaper: TrustedSource: The  
Next Generation Reputation System for]; Cannot parse '09Q2 SR Website  
Whitepaper: TrustedSource: The Next Generation Reputation System  
for': Encountered " ":" ": "" at line 1, column 42.  
Was expecting one of:  
  
 ...  
 ...  
 ...  
"+" ...  
"-" ...  
"(" ...  
"_" ...  
"^" ...  
 ...  
 ...  
\<FUZZY\_SLOP\> ...  
 ...  
 ...  
"[" ...  
"{" ...  
 ...  
; Encountered " ":" ": "" at line 1, column 42.  
Was expecting one of:_  
   
 _...  
 ...  
 ...  
"+" ...  
"-" ...  
"(" ...  
"_" ...  
"^" ...  
 ...  
 ...  
\<FUZZY\_SLOP\> ...  
 ...  
 ...  
"[" ...  
"{" ...  
 ...  
;

please tell me what is problem in there?Is elastic having any search  
string limitation or character limitation.

I''m using the following methods to get results:

SearchResponse searchResponse = client.prepareSearch(indexName)  
.setSearchType(SearchType.DEFAULT).setTypes(indexType)  
.setQuery(queryString(data).field(indexColumn))  
.execute()  
.actionGet();

Thanks

---

<div class="post-metadata">

**Author:** ![Clinton\_Gormley](https://avatars.discourse-cdn.com/v4/letter/c/50afbb/32.png) [@Clinton\_Gormley](https://discuss.elastic.co/u/Clinton_Gormley)\
**Post date:** [August 12, 2011, 8:08am UTC](https://discuss.elastic.co/t/failed-to-search-given-search-data-using-elastic-java-api/5133/2 "2011-08-12T08:08:50Z")

</div>

Hi Sam

> I'm using Elasticsearch-0.16.2 server.my search string "09Q2 SR  
> Website Whitepaper: TrustedSource: The Next Generation Reputation  
> System for".i got following error:

The colons (':') in your string are being treated as field markers. In  
the Lucene Query Parser Syntax you can specify that you want to search  
in a particular field with eg "author:(john smith)"

[Apache Lucene - Query Parser Syntax](http://lucene.apache.org/java/3_3_0/queryparsersyntax.html)

You have a few choices:

1. preprocess your search string to not include bad syntax
2. ignore the errors
3. use the 'text' family of queries via the query DSL instead  
of the query string syntax

> **[Elasticsearch Platform — Find real-time answers at scale](https://www.elastic.co)**
>
> Power insights and outcomes with the Elasticsearch Platform and AI. See into your data and find answers that matter with enterprise solutions designed to help you build, observe, and protect. Try Elasticsearch free today.

clint

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 3:57am UTC](https://discuss.elastic.co/t/failed-to-search-given-search-data-using-elastic-java-api/5133/3 "2017-07-06T03:57:21Z")

</div>


