Welcome, Guest. Register Now!
   
Mark Forums Read Mark Forums Read Mark Forums Read


Reply
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-14-2007, 01:24 PM
Junior Member
 
Join Date: Nov 2007
Posts: 2
Default Zend_search_lucene, date search

Hello,
this is my first post on this forum, I'm playing little bit with Lucene and Zend Framework.

I'm not able to find how to setup a date field and how to search
on it. E.g. I need to have all documents that have the field-abc with
yesterday date. How can i do it ?

Luca
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 02-28-2008, 10:11 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

Lucene stores its field data as text, as its purpose is as a full-text search. In other words, there aren't any data types. However, you may get some mileage out of using the string representation of the date (e.g. 2008-02-28), and then can filter your results of a Lucene search by matching the date strings up. If you need something more powerful (such as being able to determine if a date is within a range) then Lucene may not be the best solution for your app... perhaps there is a hybrid approach you can use... using Lucene to do your full-text, and get the db IDs you need to then pull the dates back from there and further filter and then display your results.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 03-03-2008, 03:48 PM
xentek's Avatar
Senior Member
 
Join Date: Feb 2008
Posts: 112
Default

Hey, I also found this recently in the Docs:

Zend Framework: Documentation: Zend_Search_Lucene: Query Language: Ranges

You may need to update your Framework from SVN, but this may be more hepful then my other advice. It uses a date range as the example.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 09-04-2008, 04:34 PM
Junior Member
 
Join Date: Sep 2008
Posts: 5
Default Cannot oder by date

I am trying to order articles by date, but seems that Zend Lucene does not boder the sorting options and it returns the same array. Any idea?

Quote:
$this->arrArticles = $indexer->Search($this->strQuery, 'Created', SORT_STRING, SORT_DESC);
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT. The time now is 10:33 PM.