# Jdbc River not\_analyzed possible?

**URL:** <https://discuss.elastic.co/t/jdbc-river-not-analyzed-possible/12026>\
**Category:** Elasticsearch\
**Created:** [May 19, 2013, 3:52pm UTC](https://discuss.elastic.co/t/jdbc-river-not-analyzed-possible/12026 "2013-05-19T15:52:09Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Andreas\_Halemba](https://avatars.discourse-cdn.com/v4/letter/a/9fc348/32.png) [@Andreas\_Halemba](https://discuss.elastic.co/u/Andreas_Halemba)\
**Post date:** [May 19, 2013, 3:52pm UTC](https://discuss.elastic.co/t/jdbc-river-not-analyzed-possible/12026/1 "2013-05-19T15:52:09Z")

</div>

Hello everyone,

i am trying to river a mysql database with battlefield3 playerstats.

the "normal" river is working perfectly. I am getting an index with the  
fetched Datas and the update works too.

my problem is, that we have players with names like "foo-barone",  
"foo-bartwo" and "bar-foo". The standard analyzer splits the Playernames  
like this:

{{"foo", "barone"},{"foo", "bartwo"},{"bar", "foo"}}

now if i am searching the player "bar-foo" i get all three players.

i have read that there is a possibility to set not\_analyzed to a field.

Would this be a solution?

An why is this not working?

curl -XPUT 'localhost:9200/\_river/soldier\_river/\_meta' -d '{  
"type": "jdbc",  
"jdbc" : {  
"driver" : "com.mysql.jdbc.Driver",  
"url" : "jdbc:mysql://xx.xx.xx.xx:3306/database",  
"user" : "user",  
"password" : "password",  
"poll" : "5s",  
"strategy" : "simple",  
"sql" : "SELECT pd.SoldierName AS \_id , pd.SoldierName as SoldierName,  
pd.CountryCode, ps.\* FROM tbl\_server\_player p LEFT JOIN tbl\_playerstats ps  
ON p.StatsID=ps.StatsID LEFT JOIN tbl\_playerdata pd ON  
pd.PlayerID=p.PlayerID"  
},  
"index" : {  
"index" : "soliderstats",  
"type" : "jdbc",  
"index\_settings" : {  
"number\_of\_replicas" : 0,  
"number\_of\_shards" : 2  
},  
"type\_mapping" : {  
"SoldierName" : {"type" : "string", "index" :  
"not\_analyzed" }  
}  
}  
}'

hopefully some body can help me solving this.

Br Andreas

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

**Author:** ![Ivan](https://avatars.discourse-cdn.com/v4/letter/i/df788c/32.png) [@Ivan](https://discuss.elastic.co/u/Ivan)\
**Post date:** [May 20, 2013, 10:56pm UTC](https://discuss.elastic.co/t/jdbc-river-not-analyzed-possible/12026/2 "2013-05-20T22:56:02Z")

</div>

What precisely is not working? Is the search still returning the 3 results?

When using a field that is not analyzed, the search must match identical  
the field being search on. Case is important and no leading/ending text  
must appear.

--  
Ivan

On Sun, May 19, 2013 at 8:52 AM, Andreas Halemba \<[andis.blackberry@gmail.com](mailto:andis.blackberry@gmail.com)

> wrote:

> Hello everyone,
> 
> i am trying to river a mysql database with battlefield3 playerstats.
> 
> the "normal" river is working perfectly. I am getting an index with the  
> fetched Datas and the update works too.
> 
> my problem is, that we have players with names like "foo-barone",  
> "foo-bartwo" and "bar-foo". The standard analyzer splits the Playernames  
> like this:
> 
> {{"foo", "barone"},{"foo", "bartwo"},{"bar", "foo"}}
> 
> now if i am searching the player "bar-foo" i get all three players.
> 
> i have read that there is a possibility to set not\_analyzed to a field.
> 
> Would this be a solution?
> 
> An why is this not working?
> 
> curl -XPUT 'localhost:9200/\_river/soldier\_river/\_meta' -d '{  
> "type": "jdbc",  
> "jdbc" : {  
> "driver" : "com.mysql.jdbc.Driver",  
> "url" : "jdbc:mysql://xx.xx.xx.xx:3306/database",  
> "user" : "user",  
> "password" : "password",  
> "poll" : "5s",  
> "strategy" : "simple",  
> "sql" : "SELECT pd.SoldierName AS \_id , pd.SoldierName as SoldierName,  
> pd.CountryCode, ps.\* FROM tbl\_server\_player p LEFT JOIN tbl\_playerstats ps  
> ON p.StatsID=ps.StatsID LEFT JOIN tbl\_playerdata pd ON  
> pd.PlayerID=p.PlayerID"  
> },  
> "index" : {  
> "index" : "soliderstats",  
> "type" : "jdbc",  
> "index\_settings" : {  
> "number\_of\_replicas" : 0,  
> "number\_of\_shards" : 2  
> },  
> "type\_mapping" : {  
> "SoldierName" : {"type" : "string", "index" :  
> "not\_analyzed" }  
> }  
> }  
> }'
> 
> hopefully some body can help me solving this.
> 
> Br Andreas
> 
> --  
> You received this message because you are subscribed to the Google Groups  
> "elasticsearch" group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
> For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<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, 2:35am UTC](https://discuss.elastic.co/t/jdbc-river-not-analyzed-possible/12026/3 "2017-07-06T02:35:38Z")

</div>

Closed on July 6, 2017, 2:35am UTC


