YousefED / ElasticUI

AngularJS directives for Elasticsearch
http://www.elasticui.com
Other
526 stars 134 forks source link

Demo is great, except for Newbies. #91

Open Tihamer54 opened 8 years ago

Tihamer54 commented 8 years ago

I'm a Lisp/Java programmer, and know nothing about AngularJS (mea culpa). I knew nothing about ElasticSearch, but I had it running in 15 minutes. Figuring out how to create new records took a bit more time, but here is how I stuffed my local database (using the Firefox Poster plugin) with 100 quotes:

Post to http://localhost:9200/quote/_bulk

{ "create": { "_index": "wisdom", "_type": "aphorism", "_id": "1" }} { "quote": { "author": "Northrop Frye", "quotation": "The most technologically efficient machine that man has ever invented is the book."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "2" }} { "quote": { "author": "Thomas Edison", "quotation": "Just because something doesn’t do what you planned it to do doesn’t mean it’s useless."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "3" }} { "quote": { "author": "Albert Einstein", "quotation": "It has become appallingly obvious that our technology has exceeded our humanity."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "4" }} { "quote": { "author": "Elbert Hubbard", "quotation": "One machine can do the work of fifty ordinary men. No machine can do the work of one extraordinary man."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "5" }} { "quote": { "author": "Douglas Adams", "quotation": "Technology is a word that describes something that doesn’t work yet."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "6" }} { "quote": { "author": "Bill Watterson", "quotation": "All this modern technology just makes people try to do everything at once."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "7" }} { "quote": { "author": "Douglas Adams", "quotation": "We are stuck with technology when what we really want is just stuff that works."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "8" }} { "quote": { "author": "R. Buckminster Fuller", "quotation": "Humanity is acquiring all the right technology for all the wrong reasons."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "9" }} { "quote": { "author": "John Brunner", "quotation": "It’s supposed to be automatic, but actually you have to push this button."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "10" }} { "quote": { "author": "Jasper Fforde", "quotation": "Books may look like nothing more than words on a page, but they are actually an infinitely complex imaginotransference technology that translates odd, inky squiggles into pictures inside your head."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "11" }} { "quote": { "author": "Kurt Vonnegut", "quotation": "I think that novels that leave out technology misrepresent life as badly as Victorians misrepresented life by leaving out sex."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "12" }} { "quote": { "author": "Aldous Huxley", "quotation": "Technological progress has merely provided us with more efficient means for going backwards."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "13" }} { "quote": { "author": "Albert Einstein", "quotation": "The human spirit must prevail over technology."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "14" }} { "quote": { "author": "Max Frisch", "quotation": "Technology… the knack of so arranging the world that we don’t have to experience it."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "15" }} { "quote": { "author": "John Cleese", "quotation": "Technology frightens me to death. It’s designed by engineers to impress other engineers. And they always come with instruction booklets that are written by engineers for other engineers — which is why almost no technology ever works."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "16" }} { "quote": { "author": "Libby Larsen", "quotation": "The great myth of our times is that technology is communication."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "17" }} { "quote": { "author": "Joseph Wood Krutch", "quotation": "Technology made large populations possible; large populations now make technology indispensable."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "18" }} { "quote": { "author": "Pablo Picasso", "quotation": "Computers are useless. They can only give you answers."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "19" }} { "quote": { "author": "Douglas Coupland", "quotation": "TV and the Internet are good because they keep stupid people from spending too much time out in public."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "20" }} { "quote": { "author": "Don DeLillo", "quotation": "This is the whole point of technology. It creates an appetite for immortality on the one hand. It threatens universal extinction on the other. Technology is lust removed from nature."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "21" }} { "quote": { "author": "Eckhart Tolle", "quotation": "The greatest achievement of humanity is not its works of art, science, or technology, but the recognition of its own dysfunction."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "22" }} { "quote": { "author": "Douglas Adams", "quotation": "First we thought the PC was a calculator. Then we found out how to turn numbers into letters with ASCII — and we thought it was a typewriter. Then we discovered graphics, and we thought it was a television. With the World Wide Web, we’ve realized it’s a brochure."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "23" }} { "quote": { "author": "Clay Shirky", "quotation": "Communications tools don’t get socially interesting until they get technologically boring."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "24" }} { "quote": { "author": "Sir Arthur C. Clarke", "quotation": "Any sufficiently advanced technology is equivalent to magic."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "25" }} { "quote": { "author": "Larry Niven", "quotation": "Ethics change with technology."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "26" }} { "quote": { "author": "Vernor Vinge", "quotation": "So much technology, so little talent."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "27" }} { "quote": { "author": "Harold Abelson", "quotation": "Programs must be written for people to read, and only incidentally for machines to execute."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "28" }} { "quote": { "author": "Alice Kahn", "quotation": "For a list of all the ways technology has failed to improve the quality of life, please press three."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "29" }} { "quote": { "author": "James Gleick", "quotation": "As a technology, the book is like a hammer. That is to say, it is perfect: a tool ideally suited to its task. Hammers can be tweaked and varied but will never go obsolete. Even when builders pound nails by the thousand with pneumatic nail guns, every household needs a hammer."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "30" }} { "quote": { "author": "Volker Grassmuck", "quotation": "The ultimate promise of technology is to make us master of a world that we command by the push of a button."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "31" }} { "quote": { "author": "Laurie Anderson", "quotation": "Technology is the campfire around which we tell our stories."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "32" }} { "quote": { "author": "Sydney J. Harris", "quotation": "The real danger is not that computers will begin to think like men, but that men will begin to think like computers."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "33" }} { "quote": { "author": "Stewart Brand", "quotation": "Once a new technology rolls over you, if you’re not part of the steamroller, you’re part of the road."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "34" }} { "quote": { "author": "Jeff Pesis", "quotation": "Hardware: the parts of a computer that can be kicked."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "35" }} { "quote": { "author": "B.F. Skinner", "quotation": "The real problem is not whether machines think but whether men do."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "36" }} { "quote": { "author": "Robert M. Pirsig", "quotation": "Technology presumes there’s just one right way to do things and there never is."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "37" }} { "quote": { "author": "Mitchell Kapor", "quotation": "Getting information off the Internet is like taking a drink from a fire hydrant."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "38" }} { "quote": { "author": "Omar N. Bradley", "quotation": "If we continue to develop our technology without wisdom or prudence, our servant may prove to be our executioner."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "39" }} { "quote": { "author": "Jared Diamond", "quotation": "Technology has to be invented or adopted."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "40" }} { "quote": { "author": "Carrie Snow", "quotation": "Technology… is a queer thing. It brings you great gifts with one hand, and it stabs you in the back with the other."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "41" }} { "quote": { "author": "Sam Ewing", "quotation": "Computers are like bikinis. They save people a lot of guesswork."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "42" }} { "quote": { "author": "John Lasseter", "quotation": "The art challenges the technology, and the technology inspires the art."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "43" }} { "quote": { "author": "Tom Hodgkinson", "quotation": "All of our technology is completely unnecessary to a happy life."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "44" }} { "quote": { "author": "Christian Lous Lange", "quotation": "Technology is a useful servant but a dangerous master."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "45" }} { "quote": { "author": "Alan Kay", "quotation": "Technology is anything that wasn’t around when you were born."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "46" }} { "quote": { "author": "Arthur M. Schlesinger", "quotation": "Science and technology revolutionize our lives, but memory, tradition and myth frame our response."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "47" }} { "quote": { "author": "Steve Jobs", "quotation": "Technology is nothing. What’s important is that you have a faith in people, that they’re basically good and smart, and if you give them tools, they’ll do wonderful things with them."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "48" }} { "quote": { "author": "Cory Doctorow", "quotation": "This is why I loved technology: if you used it right, it could give you power and privacy."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "49" }} { "quote": { "author": "Patti Smith", "quotation": "Please, no matter how we advance technologically, please don’t abandon the book. There is nothing in our material world more beautiful than the book."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "50" }} { "quote": { "author": "Simon Mainwaring", "quotation": "Technology is teaching us to be human again."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "51" }} { "quote": { "author": "J.R.R. Tolkien, The Two Towers", "quotation": "There is some good in this world, and it’s worth fighting for."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "52" }} { "quote": { "author": "H.Jackson Brown Jr., P.S. I Love You", "quotation": "Twenty years from now you will be more disappointed by the things that you didn’t do than by the ones you did do."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "53" }} { "quote": { "author": "Laurel Thatcher Ulrich, Well-Behaved Women Seldom Make History", "quotation": "Well-behaved women seldom make history."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "54" }} { "quote": { "author": "André Gide, Autumn Leaves", "quotation": "It is better to be hated for what you are than to be loved for what you are not."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "55" }} { "quote": { "author": "Oscar Wilde, A Woman of No Importance", "quotation": "Who, being loved, is poor?"} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "56" }} { "quote": { "author": "J.K. Rowling, Harry Potter and the Deathly Hallows", "quotation": "Every human life is worth the same, and worth saving."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "57" }} { "quote": { "author": "Stephen King, Different Seasons", "quotation": "Get busy living, or get busy dying."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "58" }} { "quote": { "author": "Chuck Palahniuk, Diary", "quotation": "The goal isn’t to live forever, the goal is to create something that will."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "59" }} { "quote": { "author": "David Mitchell, Cloud Atlas", "quotation": "Travel far enough, you meet yourself."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "60" }} { "quote": { "author": "Anne Rice, The Vampire Lestat", "quotation": "None of us really changes over time. We only become more fully what we are."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "61" }} { "quote": { "author": "Harper Lee, To Kill a Mockingbird", "quotation": "Most people are nice when you finally see them."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "62" }} { "quote": { "author": "Douglas Adams, The Hitchhiker’s Guide to the Galaxy", "quotation": "Don’t panic."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "63" }} { "quote": { "author": "Mitch Albom, The Five People You Meet In Heaven", "quotation": "All endings are also beginnings. We just don’t know it at the time."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "64" }} { "quote": { "author": "Paulo Coelho, The Zahir", "quotation": "When someone leaves, it’s because someone else is about to arrive."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "65" }} { "quote": { "author": "Lewis Carroll, Alice’s Adventures in Wonderland", "quotation": "It’s no use going back to yesterday, because I was a different person then."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "66" }} { "quote": { "author": "Pittacus Lore, The Power of Six", "quotation": "The only limits for tomorrow are the doubts we have today."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "67" }} { "quote": { "author": "J.K. Rowling, Harry Potter and the Chamber of Secrets", "quotation": "It is our choices that show what we truly are, far more than our abilities."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "68" }} { "quote": { "author": "Lemony Snicket, The Ersatz Elevator", "quotation": "If we wait until we’re ready, we’ll be waiting for the rest of our lives."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "69" }} { "quote": { "author": "Chuck Palahniuk, Fight Club", "quotation": "I don’t want to die without any scars."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "70" }} { "quote": { "author": "Veronica Roth, Divergent", "quotation": "Fear doesn’t shut you down; it wakes you up."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "71" }} { "quote": { "author": "Lucy Maud Montgomery, Anne of Green Gables", "quotation": "When you are imagining, you might as well imagine something worth while."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "72" }} { "quote": { "author": "Sylvia Plath, The Unabridged Journals of Sylvia Plath", "quotation": "The worst enemy to creativity is self-doubt."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "73" }} { "quote": { "author": "Oscar Wilde, The Critic as Artist", "quotation": "Yes: I am a dreamer. For a dreamer is one who can only find his way by moonlight, and his punishment is that he sees the dawn before the rest of the world."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "74" }} { "quote": { "author": "Haruki Murakami, Sputnik Sweetheart", "quotation": "I dream. Sometimes I think that’s the only right thing to do."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "75" }} { "quote": { "author": "J.R.R. Tolkien, The Fellowship of the Ring", "quotation": "Not all those who wander are lost."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "76" }} { "quote": { "author": "Tennessee Williams, Conversations with Tennessee Williams", "quotation": "If I got rid of my demons, I’d lose my angels."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "77" }} { "quote": { "author": "Philip K. Dick, Valis", "quotation": "It is sometimes an appropriate response to reality to go insane."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "78" }} { "quote": { "author": "Neil Gaiman, Make Good Art", "quotation": "If you’re making mistakes it means you’re out there doing something."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "79" }} { "quote": { "author": "Paulo Coelho, Brida", "quotation": "Even a stopped clock is right twice a day."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "80" }} { "quote": { "author": "Rick Riordan, The Lightning Thief", "quotation": "If my life is going to mean anything, I have to live it myself."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "81" }} { "quote": { "author": "Oscar Wilde, The Picture of Dorian Gray", "quotation": "To define is to limit."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "82" }} { "quote": { "author": "Thomas Merton, No Man Is an Island", "quotation": "Art enables us to find ourselves and lose ourselves at the same time."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "83" }} { "quote": { "author": "John Green, Paper Towns", "quotation": "If you don’t imagine, nothing ever happens at all."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "84" }} { "quote": { "author": "Dan Brown, Digital Fortress", "quotation": "Everything is possible. The impossible just takes longer."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "85" }} { "quote": { "author": "Norton Juster, The Phantom Tollbooth", "quotation": "So many things are possible just as long as you don’t know they’re impossible."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "86" }} { "quote": { "author": "Oscar Wilde, Lady Windermere’s Fan", "quotation": "We are all in the gutter, but some of us are looking at the stars."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "87" }} { "quote": { "author": "Haruki Murakami, What I Talk About When I Talk About Running", "quotation": "Pain is inevitable. Suffering is optional."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "88" }} { "quote": { "author": "Fyodor Dostoyevsky, The Brothers Karamazov", "quotation": "Above all, don’t lie to yourself."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "89" }} { "quote": { "author": "John Green, The Fault in Our Stars", "quotation": "Some infinities are bigger than other infinities."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "90" }} { "quote": { "author": "Cormac McCarthy, No Country For Old Men", "quotation": "You never know what worse luck your bad luck has saved you from."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "91" }} { "quote": { "author": "J.K. Rowling, Harry Potter and the Goblet of Fire", "quotation": "We must all face the choice between what is right and what is easy."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "92" }} { "quote": { "author": "Nicholas Sparks, Message in a Bottle", "quotation": "Nothing that’s worthwhile is ever easy."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "93" }} { "quote": { "author": "Chuck Palahniuk, Fight Club", "quotation": "It’s only after we’ve lost everything that we’re free to do anything."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "94" }} { "quote": { "author": "Marthe Troly-Curtin, Phrynette Married", "quotation": "Time you enjoy wasting is not wasted time."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "95" }} { "quote": { "author": "Daniel Defoe, Robinson Crusoe", "quotation": "It is never too late to be wise."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "96" }} { "quote": { "author": "Sun Tzu, The Art of War", "quotation": "Appear weak when you are strong, and strong when you are weak."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "97" }} { "quote": { "author": "Paulo Coelho, The Alchemist", "quotation": "When you want something, all the universe conspires in helping you to achieve it."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "98" }} { "quote": { "author": "Jack Kerouac, The Dharma Bums", "quotation": "One day I will find the right words, and they will be simple."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "99" }} { "quote": { "author": "Joseph Heller, Catch-22", "quotation": "Anything worth dying for is certainly worth living for."} } { "create": { "_index": "wisdom", "_type": "aphorism", "_id": "100" }} { "quote": { "author": "J.R.R. Tolkien, The Fellowship of the Ring", "quotation": "All we have to decide is what to do with the time that is given to us."} }

And I can get ten of them back with: http://localhost:9200/wisdom/_search?pretty=true&q=_:_ http://localhost:9200/wisdom/_search?pretty or all of them with: http://127.0.0.1:9200/wisdom/_search/?size=1000&pretty=1

Anyway, I grabbed a copy of demo.html from https://github.com/YousefED/ElasticUI/blob/master/examples/demo/demo.html and dropped it into my Tomcat 8.5 weapps/ROOT/ directory. I can see it fine (as expected), but naturally it's blank. I know what my indexes are by doing: http://localhost:9200/_cat/indices?v which results in: health status index pri rep docs.count docs.deleted store.size pri.store.size yellow open website 5 1 2 1 6.8kb 6.8kb yellow open wisdom 5 1 100 0 58.9kb 58.9kb

I'm running locally, so I don't need to change the cluster address: .constant('euiHost', 'http://localhost:9200');

Because of the results from the indices listing, I'm fairly certain that I'm supposed to put 'wisdom' (with single quotes) in the body line:

But I am really confused about the fields in the sidebar. What is a field? Given the data I entered above, what would a field look like? Is "field" an ElasticSearch, ElasticUI, or AngularJS term? If you're using the ElasticSearch meaning of the word, I'm even more confused because the docs say: "The fields parameter is about fields that are explicitly marked as stored in the mapping, which is off by default and generally not recommended." https://www.elastic.co/guide/en/elasticsearch/reference/current/search-request-fields.html I'm at the Pre-HelloWorld level with respect to ElasticUI. How do I change the excerpt below to make demo.html show any of from my data? ```

Search

Single select facet

Multi select facet

``` Finally, where is the submit button to actually initiate the search? Thanks a million for any help you can give. Once I get it working, I'll write up a 'Tutorial on ElasticUI for Newbies' and submit it to the GitHub repo.
YousefED commented 8 years ago

Do you get any error in the developer tools of your browser? Do you see network requests executing to Elasticsearch?

Thanks,

Tihamer54 commented 8 years ago

When I went into Firebug, I saw:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9200/wisdom/_search?size=10&from=0. (Reason: CORS header 'Access-Control-Allow-Origin' missing). ERROR: 2016-09-06T19:14:58Z [202]</Log.prototype.error@http://rawgit.com/YousefED/ElasticUI/master/examples/demo/lib/elasticsearch.angular.js:30906:56

There is a hint about how to fix this problem in your docs: If you are not serving the demo page from Elasticsearch you might have to enable CORS and allow requests to Elasticsearch from your host. which points to https://www.elastic.co/guide/en/elasticsearch/reference/current/modules-http.html

So I edited elasticsearch.yml to include: http.cors.enabled: true http.cors.allow-credentials: true http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE http.cors.max-age: 0 http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/ http.cors.allow-headers : X-Requested-With,X-Auth-Token,Content-Type,Content-Length

When I restarted elasticsearch, it worked! Well, kindof. The results show a dump of everything. If I put a single character in the search textarea, all the results disappear. So, my problem remains. What do you mean by "field", so I know what to replace "CHANGE_TO_FIELD" with?

YousefED commented 8 years ago

The field should be 'author', or 'quotation' - i.e.: a field in your documents

On Wed, Sep 7, 2016 at 7:35 PM, Tihamer54 notifications@github.com wrote:

When I went into Firebug, I saw:

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://localhost:9200/wisdom/_search?size=10&from=0. (Reason: CORS header 'Access-Control-Allow-Origin' missing). ERROR: 2016-09-06T19:14:58Z [202]</Log.prototype.error@http://rawgit.com/YousefED/ ElasticUI/master/examples/demo/lib/elasticsearch.angular.js:30906:56

There is a hint about how to fix this problem in your docs: If you are not serving the demo page from Elasticsearch you might have to enable CORS and allow requests to Elasticsearch from your host. which points to https://www.elastic.co/guide/en/elasticsearch/reference/ current/modules-http.html

So I edited elasticsearch.yml to include: http.cors.enabled: true http.cors.allow-credentials: true http.cors.allow-methods: OPTIONS,HEAD,GET,POST,PUT,DELETE http.cors.max-age: 0 http.cors.allow-origin: /https?:\/\/localhost(:[0-9]+)?/ http.cors.allow-headers : X-Requested-With,X-Auth-Token, Content-Type,Content-Length

When I restarted elasticsearch, it worked! Well, kindof. The results show a dump of everything. If I put a single character in the search textarea, all the results disappear. So, my problem remains. What do you mean by "field", so I know what to replace "CHANGE_TO_FIELD" with?

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/YousefED/ElasticUI/issues/91#issuecomment-245358279, or mute the thread https://github.com/notifications/unsubscribe-auth/AAWg2RrF6bIlHvqQNC9fJGM868I7DJa6ks5qnvX4gaJpZM4J165f .

Tihamer54 commented 8 years ago

As far as the fields being author, or quotation, I tried them. Got the exact same result. I'm attaching my demo.html (with the extension changed to txt) and a png of the result (with nothing typed in the textfield; all the quotations disappear if I type a single letter there). demo.txt elasticuidemo

BTW, I'm running Elastic 2.3.5.

Rudgey84 commented 7 years ago

Did you get this resolved as I have same issue.