在我们的 CakePHP 应用程序中,我们有一个这样的数组:
Array
(
[0] => Array
(
[Event] => Array
(
[id] => 1
[org_id] => 1
[name] => Troubadour
[url_seo] => think-alone
[description] => Lorem Ipsum is simply dummy text of the printing and 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] => US
[zipcode] => 98828
[fb_url] => https://www.facebook.com/Think Alone
[twitter_url] => https://www.twitter.com/Think Alone
[status] => A
[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] => We are a 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 and 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] => A
[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] => A
[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] => A
[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] => A
[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] => A
[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 Early Bird Experience
[inventory] => 60
[pricing] => P
[price] => 30
[more_info] => It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable Eng
[sale_start_date] => 2013-09-15
[sale_start_time] => 10.00 AM
[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] => It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout. The point of using Lorem Ipsum is that it has a more-or-less normal distribution of letters, as opposed to using 'Content here, content here', making it look like readable Eng
[sale_start_date] => 2013-09-16
[sale_start_time] => 10.00 AM
[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 to popular belief, Lorem Ipsum is not simply random text.
[category_id] => 2
[sub_category_id] => 3
[special_offer] => no
[capacity] => 30
[visibility] => E
[location] => Los Angeles
[address] => The Echo 1822 W Sunset Blvd Los Angeles, California, 90026
[city] => Los Angeles
[state] => California
[country] => US
[zipcode] => 90026
[fb_url] => http://www.facebook.com/music-night
[twitter_url] => http://www.twitter.com/music-night
[status] => A
[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] => We are a 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 and 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
(
)
)
)
我们想索引这个数组并想用事件名称、组织名称、事件城市等搜索事件。
我们所做的 ?
我们在 Solr 中非常新,我们目前正在为此使用 SolrPhpClient,但是基于这个数组变得非常困难......
感谢所有帮助....
更新
我们有一个 cakephp 应用程序,其中有搜索功能。所以我们想集成 Apache solr 进行搜索...
这是我们遵循的教程:
http://www.webdesignermag.co.uk/tutorials/how-to-add-search-with-solr/
但是对于 Pure php ,我们需要将它集成到 cakephp 中。
我们应该怎么做?
根据上面的教程,在搜索之前需要先索引所有的数据和记录......
所以上面的数组是我们现在所有的数据..
当我们输入搜索文本 asTroubadour
和城市 asIndianapolis
时,搜索条件如下:
( Event.name = Troubadour OR Event.location = Troubadour OR Organization.name = Troubadour) AND Event.city = Indianapolis
这是我们的场景......
任何人帮助我......它浪费了我的 3 天,但仍然......