How to index and search array in solr with PHP -


in our cakephp application, have array this:

array (     [0] => array         (             [event] => array                 (                     [id] => 1                     [org_id] => 1                     [name] => troubadour                     [url_seo] => think-alone                     [description] => lorem ipsum dummy text of printing , typesetting industry.                      [category_id] => 1                     [sub_category_id] => 1                     [special_offer] => yes                     [capacity] => 100                     [visibility] => e                     [location] => old national centre     502 north new jersey st indianapolis, in, 46204                     [address] => old national centre      502 north new jersey st indianapolis, in, 46204                     [city] => indianapolis                     [state] => wa                     [country] =>                     [zipcode] => 98828                      [fb_url] => https://www.facebook.com/think alone                     [twitter_url] => https://www.twitter.com/think alone                     [status] =>                     [featured] => y                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [organization] => array                 (                     [id] => 1                     [user_id] => 2                     [name] =>  test org                     [company_profile] => company built on integrity                     [motto] => engineering knowledge                     [logo] =>                      [website] => http://www. test org.com/                     [subdomain] =>                      [timezone] =>                      [currency] =>                      [video_link] =>                      [company_email] => info@ test org.com                     [contact_address] =>  test org technologies. 4th , 5th floor,  asset iris building, n f gate main road, tripunithura, cochin,  india    - 682 301                     [contact_phone] => + 91 484 2785 833                     [contact_mobile] =>                      [city] => cochin                     [state] => ernakulam                     [country] => india                     [zipcode] => 682 301                     [email_notification] => 1                     [fb_url] => https://www.facebook.com/ test org                     [twitter_url] => https://www.twitter.com/ test org                     [status] => 1                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [category] => array                 (                     [id] => 1                     [name] => business                     [image] =>                      [category_code] => business                     [status] => 1                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [subcategory] => array                 (                     [id] => 1                     [category_id] => 1                     [name] => advertising & marketing                      [image] =>                      [status] => 1                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [eventdate] => array                 (                     [0] => array                         (                             [id] => 1                             [event_id] => 1                             [start_date] => 2013-09-21                             [start_time] => 10:00:00                             [start_session] =>                             [end_date] => 2013-09-22                             [end_time] => 5:00:00                             [end_session] => p                             [created] => 2013-09-13 00:00:00                             [modified] => 2013-09-13 00:00:00                         )                      [1] => array                         (                             [id] => 9                             [event_id] => 1                             [start_date] => 2013-09-23                             [start_time] => 10:00:00                             [start_session] =>                             [end_date] => 2013-09-24                             [end_time] => 5:00:00                             [end_session] => p                             [created] => 2013-09-19 00:00:00                             [modified] => 2013-09-19 00:00:00                         )                      [2] => array                         (                             [id] => 7                             [event_id] => 1                             [start_date] => 2013-09-27                             [start_time] => 10:00:00                             [start_session] =>                             [end_date] => 2013-09-28                             [end_time] => 5:00:00                             [end_session] => p                             [created] => 2013-09-18 00:00:00                             [modified] => 2013-09-18 00:00:00                         )                      [3] => array                         (                             [id] => 14                             [event_id] => 1                             [start_date] => 2013-09-29                             [start_time] => 10:00:00                             [start_session] =>                             [end_date] => 2013-09-30                             [end_time] => 5:00:00                             [end_session] => p                             [created] => 2013-09-25 00:00:00                             [modified] => 2013-09-25 00:00:00                         )                      [4] => array                         (                             [id] => 6                             [event_id] => 1                             [start_date] => 2013-10-15                             [start_time] => 10:00:00                             [start_session] =>                             [end_date] => 2013-10-15                             [end_time] => 5:00:00                             [end_session] => p                             [created] => 2013-09-18 00:00:00                             [modified] => 2013-09-18 00:00:00                         )                  )              [eventmedia] => array                 (                     [0] => array                         (                             [id] => 1                             [event_id] => 1                             [image_url] => upcom-img1.jpg                             [video_url] =>                              [created] => 2013-09-25 00:00:00                             [modified] => 2013-09-25 00:00:00                         )                      [1] => array                         (                             [id] => 6                             [event_id] => 1                             [image_url] => upcom-img4.jpg                             [video_url] =>                              [created] => 0000-00-00 00:00:00                             [modified] => 0000-00-00 00:00:00                         )                  )              [eventticket] => array                 (                     [0] => array                         (                             [id] => 1                             [event_id] => 1                             [name] => vip bird experience                             [inventory] => 60                             [pricing] => p                             [price] => 30                             [more_info] => long established fact reader distracted readable content of page when looking @ layout. point of using lorem ipsum has more-or-less normal distribution of letters, opposed using 'content here, content here', making readable eng                             [sale_start_date] => 2013-09-15                             [sale_start_time] => 10.00                             [sale_end_date] => 2013-09-20                             [sale_end_time] => 5.00 pm                             [min_tickets_per_order] => 1                             [max_tickets_per_order] => 1                             [ticket_series] => 1_1000                             [created] => 2013-09-13 00:00:00                             [modified] => 2013-09-13 00:00:00                         )                      [1] => array                         (                             [id] => 2                             [event_id] => 1                             [name] => craft beer heaven                             [inventory] => 40                             [pricing] => p                             [price] => 20                             [more_info] => long established fact reader distracted readable content of page when looking @ layout. point of using lorem ipsum has more-or-less normal distribution of letters, opposed using 'content here, content here', making readable eng                             [sale_start_date] => 2013-09-16                             [sale_start_time] => 10.00                             [sale_end_date] => 2013-09-20                             [sale_end_time] => 5.00 pm                             [min_tickets_per_order] => 1                             [max_tickets_per_order] => 1                             [ticket_series] => 1_1061                             [created] => 2013-09-13 00:00:00                             [modified] => 2013-09-13 00:00:00                         )                  )          )      [1] => array         (             [event] => array                 (                     [id] => 10                     [org_id] => 1                     [name] => music night                     [url_seo] => music-night                     [description] => contrary popular belief, lorem ipsum not random text.                      [category_id] => 2                     [sub_category_id] => 3                     [special_offer] => no                     [capacity] => 30                     [visibility] => e                     [location] => los angeles                     [address] => echo     1822 w sunset blvd los angeles, california, 90026                     [city] => los angeles                     [state] => california                     [country] =>                     [zipcode] => 90026                     [fb_url] => http://www.facebook.com/music-night                     [twitter_url] => http://www.twitter.com/music-night                     [status] =>                     [featured] => n                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [organization] => array                 (                     [id] => 1                     [user_id] => 2                     [name] =>  test org                     [company_profile] => company built on integrity                     [motto] => engineering knowledge                     [logo] =>                      [website] => http://www. test org.com/                     [subdomain] =>                      [timezone] =>                      [currency] =>                      [video_link] =>                      [company_email] => info@ test org.com                     [contact_address] =>  test org technologies. 4th , 5th floor,  asset iris building, n f gate main road, tripunithura, cochin,  india    - 682 301                     [contact_phone] => + 91 484 2785 833                     [contact_mobile] =>                      [city] => cochin                     [state] => ernakulam                     [country] => india                     [zipcode] => 682 301                     [email_notification] => 1                     [fb_url] => https://www.facebook.com/ test org                     [twitter_url] => https://www.twitter.com/ test org                     [status] => 1                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [category] => array                 (                     [id] => 2                     [name] => music & nightlife                     [image] =>                      [category_code] => music                     [status] => 1                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [subcategory] => array                 (                     [id] => 3                     [category_id] => 2                     [name] => music sub1                     [image] =>                      [status] => 1                     [created] => 2013-09-13 00:00:00                     [modified] => 2013-09-13 00:00:00                 )              [eventdate] => array                 (                 )              [eventmedia] => array                 (                 )              [eventticket] => array                 (                 )          )  ) 

we want index array , want search events event-name, organization-name, event-city etc....

what ?

we new in solr , using solrphpclient this, based on array become difficult....

all helps appreciated....

update


we have cakephp apllication, in there have search fetaure. want integrate apache solr searching...

this tutorial followed :

http://www.webdesignermag.co.uk/tutorials/how-to-add-search-with-solr/ 

bu pure php , need integrate in cakephp.

how can this?

according above tutorial, there need first index data , records before searching....

so above array our data now..

when enter searching text troubadour , city indianapolis , searching condition below:

( event.name = troubadour or event.location = troubadour or organization.name = troubadour) , event.city = indianapolis 

this our scenario....

anyboady me...its wasting 3 day , still.....

assuming can't filter data directly in database , have filter resulting array (but please, explain why can't), cakephp let extract filtered data array this:

$filteredarray = hash::extract($array, '{n}.event[name=troubadour]'); 

see cakephp hash

hope answer question


Comments

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -