On 5/23/05, Stefan Urbanek <[EMAIL PROTECTED]> wrote:
> Citát Yen-Ju Chen <[EMAIL PROTECTED]>:
> 
[snip]
> Great! Thank you :) I have looked at it through web-cvs, as I am at work at 
> the
> moment.
> 
> If I understand it correctly, then the LuceneKit is used as follows:
> 1. create an index repository (LC*Directory)
> 2. index "documents" by providing indexable fields
> 3. search by using queries. query is term + occurence type
> 
> Now, if I would like to index any Objective-C objects I just create a 
> LCDocument
> for each object and LCField for each indexable attribute (ivar). Right?

  Basically, yes, as long as you can convert ivar into text.
  There are two classes, LCNumberTool and LCDateTool,
  to help convert number and date.

> Also, what is stored in the LCDocument object? full contents of the attribute?
> Say I have a long NSAttributedString. I do:
> 
> field = [[LCField alloc] initWithName: @"content"
>                            string: [myAttrString string]
>                             store: LCStore_NO
>                             index: LCIndex_Tokenized];
> 
> Is it stored there or the contents is used only for indexing? Or is it what 
> the
> LCStore_NO says?

  There are two ways to store the content. One is LCStore, the other is LCIndex.
  They are independent.
  LCStore will stored the all context as it is.
  Therefore, you can retrieve the whole content from the LCDocument.
  LCIndex will pass the content through an analyzer, which will chop
the content,
  therefore, you can still do the search, but you cannot retrive the
whole content.
  So in general, in each LCDocument, you will have an field with
LCStore_YES and LCIndex_Untokenized.
  This field will serve as a unique keyword so that after the search,
  you can find the relationship between LCDocument and your object.
  If your object is file, the keyword is usually file path.
  If your object is a person's contact information, the keyword can be
the person's name
  or the internal id of the object.
  For other field, it depends on your need.
  LCStore_NO/LCIndex_Tokenized is generally used for search and reduce
the size of index.
  
  I still need to look into the LCStore, LCIndex for more details.
  But this is what I understand for now.
  
  Yen-Ju
  

> 
> Thank you,
> 
> Stefan Urbanek
> --
> http://stefan.agentfarms.net
> 
> First they ignore you, then they laugh at you, then they fight you, then
> you win.
> - Mahatma Gandhi
> 
> _______________________________________________
> Etoile-dev mailing list
> [email protected]
> https://mail.gna.org/listinfo/etoile-dev
>

Reply via email to