Re: forcing meta values when indexing

Peter Karman <[email protected]> Sun, 24 Sep 2006 09:35:51 -0700 (PDT)
Newsgroups gmane.comp.web.swish-e
Message-ID <[email protected]>

Philippe A. scribbled on 9/24/06 10:42 AM:
> I am working on a small web resume searching tool. Each candidate is
> represented in a db. The candidate info points to the resume filename. I am
> using swish to index and search resumes. When it returns search results, I
> need to know to which candidate each document belongs. Is there a way I can
> join the candidate_id along the indexed documents? I thought an indexing
> option would allow me to do that, as I've seen this in other products
> (Zend_Search to name it).
> 


sounds like you want to store the candidate_id as a PropertyName for each resume 
document.

Example:

[karpet@cartermac:~/tmp/resume]$ cat c
PropertyNames candidate_id text
MetaNameAlias swishdefault text
IndexContents XML* .xml

[karpet@cartermac:~/tmp/resume]$ cat ex.xml
<resume>
   <candidate_id>someid</candidate_id>
   <text>
    all my glorious history and why you should hire me stuff here
   </text>
</resume>

[karpet@cartermac:~/tmp/resume]$ swish-e -w 'hire me' -x '"<candidate_id>" 
"<swishtitle>" "<text>"\n'
# SWISH format: 2.5.4
# Search words: hire me
# Removed stopwords:
# Number of hits: 1
# Search time: 0.005 seconds
# Run time: 0.033 seconds
"someid" "ex.xml" "all my glorious history and why you should hire me stuff here"
.

-- 
Peter Karman  .  http://peknet.com/  .  [email protected]