Hi,
Finally I found forum for Laravel learners. I am struggling with last couple of days for integrating Elastic search to my website. I follow the below tutorial. https://github.com/mmanos/laravel-search
In that one, we have some Search functions. Where should i need to add those.
In this, there is something like $searchParams['body']['query']['query_string']['query'] = 'foofield:barstring';
Now, i called this is in my controller but getting error as unreadable formate.
Error: <!DOCTYPE html> <html> <head> <meta charset="utf-8"> <title>Whoops! There was an error.</title> <style>.cf:before, .cf:after {content: " ";display: table;} .cf:after {clear: both;} .cf {*zoom: 1;} body { font: 14px helvetica, arial, sans-serif; color: #2B2B2B; background-color: #D4D4D4; padding:0; margin: 0; max-height: 100%; } a { text-decoration: none; } .container{ height: 100%; width: 100%; position: fixed; margin: 0; padding: 0; left: 0; top: 0; } .branding { position: absolute; top: 10px; right: 20px; color: #777777; font-size: 10px; z-index: 100; } .branding a { color: #CD3F3F; } header { padding: 30px 20px; color: white; background: #272727; box-sizing: border-box; border-left: 5px solid #CD3F3F; } .exc-title { margin: 0; color: #616161; text-shadow: 0 1px 2px rgba(0, 0, 0, .1); } .exc-title-primary { color: #CD3F3F; } .exc-message { font-size: 32px; margin: 5px 0; word-wrap: break-word; } .stack-container { height: 100%; position: relative; } .details-container { height: 100%; overflow: auto; float: right; width: 70%; background: #DADADA; } .details { padding: 10px; padding-left: 5px; border-left: 5px solid rgba(0, 0, 0, .1); } .frames-container { height: 100%; overflow: auto; float: left; width: 30%; background: #FFF; } .frame { padding: 14px; background: #F3F3F3; border-right: 1px solid rgba(0, 0, 0, .2); cursor: pointer; } .frame.active { background-color: #4288CE; color: #F3F3F3; box-shadow: inset -2px 0 0 rgba(255, 255, 255, .1); text-shadow: 0 1px 0 rgba(0, 0, 0, .2); } .frame:not(.active):hover { background: #BEE9EA; }
How query know about the table name here. Where should i need to put this code exactly. help me out plz..
Hi guys... any updates please. whatever i send the params it through an error like above.
I don't have experience with elastic, but I would ask this over at the github page as I expect you will get a better response there.
If it was me I would build the index on saving the record - could be in the controller or in the model
Then perform the search in your search controller
the error was a Whoops? Try using Block Try-Catch to check your code is work fine or not.
First of all you have to index all the data on elasticsearch server. After that you have to specify following code where ever you want to pull the data from elasticsearch.
$searchParams['index'] = 'Your Index Name'; $searchParams['type'] = 'Your Type Name'; // Nothing but Collection or Table Name. $searchParams['body']['query']['query_string']['query'] = 'foofield:barstring';
Sign in to participate in this thread!
The Laravel portal for problem solving, knowledge sharing and community building.
The community