Field.Keyword is suitable for storing data like Url.  Give that a try.

Otis

--- Morris Mizrahi <[EMAIL PROTECTED]> wrote:
> Hey everyone.
> 
>  
> 
> My document object for my lucene index has a "url" field.
> 
> I have created "url" as a Text field.  
> 
> The problem I am having is that searches with a "url" that end with a
> number, e.g. "e:\k2_beta1", don't return any hits even though there
> is
> data that should match this search criteria. If you have a "url" that
> ends with a letter, e.g. "e:\k2_alpha", the search works fine and
> returns the correct hits.
> 
>  
> 
> Here are some code snippets of my work:
> 
> IndexCreation:
> 
> writer = new IndexWriter("index", new StandardAnalyzer(), true);
> 
>   
> 
> create the "url" as a Text field:
> 
>             doc.add(Field.Text("url", url));
> 
>  
> 
> search code:
> 
>         Analyzer analyzer = new StandardAnalyzer();
> 
>         DateFilter filter = ((SearchForm) form).getDateFilter();
> 
>         Searcher searcher = new
> IndexSearcher(IndexReader.open(indexPath));
> 
>         Query query = QueryParser.parse(terms, "contents", analyzer);
> 
>         Hits hits = searcher.search(query, filter);
> 
>  
> 
> I have tried changing the "url" field from Text to Keyword. 
> 
> This didn't work and also caused my searches for any "url" to fail. 
> 
> I am using lucene 1.2
> 
>  
> 
> I know I need the proper combinations of Analyzer and Field type. 
> 
>  
> 
> Any help would be appreciated.
> 
>  
> 
> Thanks.
> 
>  
> 
>         Morris
> 
>  
> 
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to