Showing posts with label information retrieval. Show all posts
Showing posts with label information retrieval. Show all posts

Sunday, February 5, 2012

Query Clause "OR", "AND" in Sphinx Search Engine

Hello,

sometimes we want to sphinx to search in specific index like address and state, but sometimes we want to make it's like mysql query who support "or", "and" clause.

it's many ways to do that, but i wanna share simple one (for me it's simple one :D)

hmm.. i use sphinx 1.10. and without bullshit it's the sample code you can use for "or", "and" cluase:


$results = $sc->Query('@title  javascript & @city newyork | @country "united state");

just like that, it's simple right :D just use " | " for "or" and "&" for "and".

$sc in there is variable you use for define sphinx api in your code..

hope it's usefull for you :D


       

Thursday, February 17, 2011

Lucene VS Sphinx

Hmm..lagi nyari nyari tugas kuliah information retrieval tentang sphinxsearch jadi kepikiran knapa harus pakai sphinx yah? kenapa gak lucene aja? seengaknya kan lucene udah ada support dari zend (yang gw tau...gak tau klo sphinx :D), jadi pasti lebih banyak tutorial buat developer php yang mau gunain aplikasi search yang advance buat webnya :D
mungkin ini sedikit info tentang lucene dan sphinx yang gw dapetin.....