Always get max results using search from browser


(Dave K) #1

We recently began using browsers to make Elastic Search searches. No matter what I enter into the browser for a
_search "search string" I receive ALL records as a result. Am I formatting my searches incorrectly or what seems to be the problem? Following are some queries I've submitted that have returned ALL records back.

http://192.168.1.162:9200/fbo_redo/_search?match_all
http://192.168.1.162:9200/fbo_redo/_search?ede98706-964c-4edc-bd83-278d964fb522
http://192.168.1.162:9200/fbo_redo/_search?q=agency:Defense Logistics Agency

This query returned ONLY the asked for id:
http://localhost:9200/myindexname/BlogPost/_search?q=id:ede98706-964c-4edc-bd83-278d964fb522

Can anyone tell me what's wrong?

Thanks,

Dave K


(Mark O Stewart) #2

do you have sense installed somewhere? (I use Google Sense plugin for Chrome. also a plugin for Kibana)

Put http://192.168.1.162:9200/ into server field.

now get indices just to be sure your connected correct. Run this command
/GET /_cat/indices?v=pretty

Paste one of your queries into the sense panel. (it will remove the http://192.168.1.162:9200/ url part that needs to go into the top Server field)

run query and see what returns.

Let us know what happened.


(Daniel Mitterdorfer) #3

Hi @dkarnecki,

For a more convenient alternative, you should consider Console which allows you to use the query DSL.

When you use URI search, you have to provide your query using the q request parameter.

Cannot work, q is missing.

You should quote the parameter value, i.e.:

http://192.168.1.162:9200/fbo_redo/_search?q=agency:"Defense Logistics Agency"

Looks ok to me.

See the reference docs for more examples.

Daniel


(Mark O Stewart) #4

Also noticed the
http://192.168.1.162:9200/fbo_redo/_search?ede98706-964c-4edc-bd83-278d964fb522
should be like
http://192.168.1.162:9200/fbo_redo/_search?q=ede98706-964c-4edc-bd83-278d964fb522

look closely at the format of strings they are not correct.

Just saw Daniels post after I posted this.

MS


(system) #5