Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [Symfony][Symfony2][inny]Wyszukiwarka - ElasticaBundle, SoirBundle - zwraca pusty wynik
michau85
post
Post #1





Grupa: Zarejestrowani
Postów: 87
Pomógł: 1
Dołączył: 3.01.2010

Ostrzeżenie: (0%)
-----


Witajcie
Chcę w projekcie symfony zaimplementować wyszukiwarkę produktów. Chciałbym wykorzystać do tego np. ElasticaBundle. Nie wiem co robię źle,bo rezultatem wyszukiwania jest pusta tablica. Jeśli chodzi o Elastica to próbowałem nawet przepisać ten przykład który jest w dokumentacji na githubie Moja konfiguracja wygląda tak:
  1.  
  2.  
  3. /// Controller
  4.  
  5. public function indexAction() {
  6. $finder = $this->container->get('fos_elastica.finder.app.user');
  7. $results = $finder->find('Ula');
  8. ///return new Response($results);
  9. var_dump($results);
  10. }
  11.  
  12.  
  13. ///app/config.yml
  14.  
  15. fos_elastica:
  16. clients:
  17. default: { host: localhost, port: 3306}
  18. indexes:
  19. app:
  20. types:
  21. user:
  22. mappings:
  23. username:
  24. type: string
  25. firstName:
  26. type: string
  27. lastName:
  28. type: string
  29. email:
  30. type: string
  31. persistence:
  32. # the driver can be orm, mongodb, phpcr or propel
  33. # listener and finder are not supported by
  34. # propel and should be removed
  35. driver: orm
  36. model: SklepBundle\Entity\User
  37. provider: ~
  38. finder: ~
  39. listener: ~
  40.  
  41.  


Próbowałem też użyć SoirBundle, ale skutek jest podobny. Dodam jeszcze że pracuję na xampie. Będę wdzieczny za podpowiedzi
Go to the top of the page
+Quote Post
kpt_lucek
post
Post #2





Grupa: Zarejestrowani
Postów: 428
Pomógł: 77
Dołączył: 10.07.2011
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


A wrzuciłeś dane w index?


--------------------


Cytat
There is a Bundle for that
Lukas Kahwe Smith - October 31th, 2014
Go to the top of the page
+Quote Post
michau85
post
Post #3





Grupa: Zarejestrowani
Postów: 87
Pomógł: 1
Dołączył: 3.01.2010

Ostrzeżenie: (0%)
-----


Nie wiem czy dobrze Cię rozumiem. W phpmyadmin ma po prost dane w bazie. Nie oznaczałem kolumn indeksami . Jeśli chodzi Ci o wykonanie polecenia php app/console fos:elastica:populate to w rezultacie dostaje takie komunikaty:
Resetting app
0/3-------0%
%message%
3/3-------100%
Populating app/userRefreshing app
Refreshing app

Nie wiem jak mam je rozumieć.
Go to the top of the page
+Quote Post
ohm
post
Post #4





Grupa: Zarejestrowani
Postów: 623
Pomógł: 144
Dołączył: 22.12.2010

Ostrzeżenie: (0%)
-----


  1. clients:
  2. default: { host: localhost, port: 3306}

A tutaj nie powinienes zmienić port na elasticę? 9200 domyślnie

Go to the top of the page
+Quote Post
michau85
post
Post #5





Grupa: Zarejestrowani
Postów: 87
Pomógł: 1
Dołączył: 3.01.2010

Ostrzeżenie: (0%)
-----


Jak zmieniam port na 9200 to pojawia się informacja o braku połączenia z hostem.
Go to the top of the page
+Quote Post
kpt_lucek
post
Post #6





Grupa: Zarejestrowani
Postów: 428
Pomógł: 77
Dołączył: 10.07.2011
Skąd: Warszawa

Ostrzeżenie: (0%)
-----


A zainstalowałeś ElasticSearch?


--------------------


Cytat
There is a Bundle for that
Lukas Kahwe Smith - October 31th, 2014
Go to the top of the page
+Quote Post
michau85
post
Post #7





Grupa: Zarejestrowani
Postów: 87
Pomógł: 1
Dołączył: 3.01.2010

Ostrzeżenie: (0%)
-----


Nie. A trzeba coś jeszcze dodatkowo instalować oprócz FOSElasticaBundle?
Go to the top of the page
+Quote Post
nospor
post
Post #8





Grupa: Moderatorzy
Postów: 36 557
Pomógł: 6315
Dołączył: 27.12.2004




Jak sie czyta dokumentacje to trzeba to robic dokladnie a nie co piate zdanie

https://github.com/FriendsOfSymfony/FOSElas...es/doc/setup.md
Cytat
Elasticsearch

Instructions for installing and deploying Elasticsearch may be found here.


Bundle ktorego uzywasz to tylko pomost miedzy php a Elastic


--------------------

"Myśl, myśl, myśl..." - Kubuś Puchatek || "Manual, manual, manual..." - Kubuś Programista
"Szukaj, szukaj, szukaj..." - Kubuś Odkrywca || "Debuguj, debuguj, debuguj..." - Kubuś Developer

Go to the top of the page
+Quote Post
dandaj
post
Post #9





Grupa: Zarejestrowani
Postów: 3
Pomógł: 1
Dołączył: 14.03.2017

Ostrzeżenie: (10%)
X----


Elasticsearch to oddzielny host bazy danych, musisz go zainstalować na serwerze i uruchamiać tak samo jak np. xamppa lub nginxa.
Następnie wrzucić to co chcesz do bazy elasticsearch.
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 02:29