Full Text Search not working in elasticsearch with couchdb - river plugin


(Akbar Ali) #1

Hi,
I am trying to achieve full text search with elastic search. I created
index using the following request

curl -XPUT "http://192.168.1.90:9200/_river/elastictest/_meta" -d'

{

  • "type" : "couchdb",*

  • "couchdb" : {*

  •    "host" : "localhost",*
    
  •    "ignore_attachments":true,*
    
  •    "port" : 5984,*
    
  •    "db" : "elastictest",*
    
  •    "filter" : null*
    
  • },*

  • "index" : {*

  •    "index" : "elastictest",*
    
  •    "type" : "elastictest",*
    
  •    "bulk_size" : "100",*
    
  •    "bulk_timeout" : "10ms"*
    
  • }*

*}' *

following is my document in couchdb in the database elastictest

{

  • "_id": "c0a14920f39ee4127446be81db000172",*

  • "_rev": "2-58e0fefa2cbfa6e3fdbb2a6ff3933740",*

  • "name": "akbarali",*

  • "company": {*

  •   "name": "Mobinius",*
    
  •   "location": "Bangalore"*
    
  • }*

}

following is my query

curl -XPOST
"http://192.168.1.90:9200/elastictest/elastictest/_search?size=10&from=0"
-d'

{

"query" : {

  •    "multi_match" : {*
    
  •    "query" : "a",*
    
  •    "fields" : [ "name", "company.location"]*
    
  • }*

}

}'

And it returns

{

  • "took": 1,*

  • "timed_out": false,*

  • "_shards": {*

  •  "total": 5,*
    
  •  "successful": 5,*
    
  •  "failed": 0*
    
  • },*

  • "hits": {*

  •  "total": 0,*
    
  •  "max_score": null,*
    
  •  "hits": []*
    
  • }*

*} *

Also in the query, if i replace a with full name akbarali, it returns one
row, i also trued a.* that also doesn't work
And i would like to know how to change the default index since there are
lot of unwanted filed included in the default indexing

Regards
Akbar

--
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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/037f2217-2e64-4733-a1e8-72475633c821%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Ivan Brusic) #2

If you are using the standard default analyzer, then "a" is considered a
stopword and will be removed from your query. Try with a different query.

--
Ivan

On Fri, Jan 24, 2014 at 2:27 AM, Akbar Ali akbarali1klr@gmail.com wrote:

Hi,
I am trying to achieve full text search with elastic search. I created
index using the following request

curl -XPUT "http://192.168.1.90:9200/_river/elastictest/_meta
http://192.168.1.90:9200/_river/elastictest/_meta" -d'

{

  • "type" : "couchdb",*

  • "couchdb" : {*

  •    "host" : "localhost",*
    
  •    "ignore_attachments":true,*
    
  •    "port" : 5984,*
    
  •    "db" : "elastictest",*
    
  •    "filter" : null*
    
  • },*

  • "index" : {*

  •    "index" : "elastictest",*
    
  •    "type" : "elastictest",*
    
  •    "bulk_size" : "100",*
    
  •    "bulk_timeout" : "10ms"*
    
  • }*

*}' *

following is my document in couchdb in the database elastictest

{

  • "_id": "c0a14920f39ee4127446be81db000172",*

  • "_rev": "2-58e0fefa2cbfa6e3fdbb2a6ff3933740",*

  • "name": "akbarali",*

  • "company": {*

  •   "name": "Mobinius",*
    
  •   "location": "Bangalore"*
    
  • }*

}

following is my query

curl -XPOST
"http://192.168.1.90:9200/elastictest/elastictest/_search?size=10&from=0
http://192.168.1.90:9200/elastictest/elastictest/_search?size=10&from=0"
-d'

{

"query" : {

  •    "multi_match" : {*
    
  •    "query" : "a",*
    
  •    "fields" : [ "name", "company.location"]*
    
  • }*

}

}'

And it returns

{

  • "took": 1,*

  • "timed_out": false,*

  • "_shards": {*

  •  "total": 5,*
    
  •  "successful": 5,*
    
  •  "failed": 0*
    
  • },*

  • "hits": {*

  •  "total": 0,*
    
  •  "max_score": null,*
    
  •  "hits": []*
    
  • }*

*} *

Also in the query, if i replace a with full name akbarali, it returns one
row, i also trued a.* that also doesn't work
And i would like to know how to change the default index since there are
lot of unwanted filed included in the default indexing

Regards
Akbar

--
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.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/037f2217-2e64-4733-a1e8-72475633c821%40googlegroups.com
.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/CALY%3DcQBqqitBPVop0L45%2BQwDsk-weQhffw2DP7OivSyf5o4uyQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.


(Akbar Ali) #3

Hi Ivan,
Thanks for the reply. I changed the query to "akb" , but still
i am not able to get the result. I tried to play around with values and
queries a little, Suppose I have a field "name" with value "This is
going well
", and "Sushil" in two documents, it gives me fail result
mentioned below for the below queries

POST /elastictest/elastictest/_search?size=10&from=0
{

  • "query": {*
  • "match": {*
  •  "_all": {*
    
  •    "query": "This is going well", // "Th" , This => Failure*
    
  •    "operator": "or"*
    
  •  }*
    
  • }*
  • } *
    }

POST /elastictest/elastictest/_search?size=10&from=0
{

  • "query": {*
  • "match": {*
  •  "_all": {*
    
  •    "query": "Sushil", // Success*
    
  •    "operator": "or"*
    
  •  }*
    
  • }*
  • } *
    }

I expect sentences with some words or only words as expected values of my
fields and i would like to search then with letters. Can you guide me a way
do achieve this?

and it is success only for
On Saturday, 25 January 2014 23:28:56 UTC+5:30, Ivan Brusic wrote:

If you are using the standard default analyzer, then "a" is considered a
stopword and will be removed from your query. Try with a different query.

--
Ivan

On Fri, Jan 24, 2014 at 2:27 AM, Akbar Ali <akbara...@gmail.com<javascript:>

wrote:

Hi,
I am trying to achieve full text search with elastic search. I created
index using the following request

curl -XPUT "http://192.168.1.90:9200/_river/elastictest/_meta
http://192.168.1.90:9200/_river/elastictest/_meta" -d'

{

  • "type" : "couchdb",*

  • "couchdb" : {*

  •    "host" : "localhost",*
    
  •    "ignore_attachments":true,*
    
  •    "port" : 5984,*
    
  •    "db" : "elastictest",*
    
  •    "filter" : null*
    
  • },*

  • "index" : {*

  •    "index" : "elastictest",*
    
  •    "type" : "elastictest",*
    
  •    "bulk_size" : "100",*
    
  •    "bulk_timeout" : "10ms"*
    
  • }*

*}' *

following is my document in couchdb in the database elastictest

{

  • "_id": "c0a14920f39ee4127446be81db000172",*

  • "_rev": "2-58e0fefa2cbfa6e3fdbb2a6ff3933740",*

  • "name": "akbarali",*

  • "company": {*

  •   "name": "Mobinius",*
    
  •   "location": "Bangalore"*
    
  • }*

}

following is my query

curl -XPOST
"http://192.168.1.90:9200/elastictest/elastictest/_search?size=10&from=0
http://192.168.1.90:9200/elastictest/elastictest/_search?size=10&from=0"
-d'

{

"query" : {

  •    "multi_match" : {*
    
  •    "query" : "a",*
    
  •    "fields" : [ "name", "company.location"]*
    
  • }*

}

}'

And it returns

{

  • "took": 1,*

  • "timed_out": false,*

  • "_shards": {*

  •  "total": 5,*
    
  •  "successful": 5,*
    
  •  "failed": 0*
    
  • },*

  • "hits": {*

  •  "total": 0,*
    
  •  "max_score": null,*
    
  •  "hits": []*
    
  • }*

*} *

Also in the query, if i replace a with full name akbarali, it returns
one row, i also trued a.* that also doesn't work
And i would like to know how to change the default index since there are
lot of unwanted filed included in the default indexing

Regards
Akbar

--
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 elasticsearc...@googlegroups.com <javascript:>.
To view this discussion on the web visit
https://groups.google.com/d/msgid/elasticsearch/037f2217-2e64-4733-a1e8-72475633c821%40googlegroups.com
.
For more options, visit 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.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/2366ecbb-61c9-4d06-80e8-584fc95485c1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


(system) #4