lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "George Aroush" <geo...@aroush.net>
Subject RE: how do I get the multisearcher to work.
Date Thu, 25 May 2006 17:52:22 GMT
Hi Pam,

Can you be more specific?  Do you mean it works with 1.4.3 or do you mean
when you replace the HashTable to HashSet it works?

Thanks.

-- George Aroush 

-----Original Message-----
From: Pamela Foxcroft [mailto:pamelafoxcroft@gmail.com] 
Sent: Thursday, May 25, 2006 1:12 PM
To: lucene-net-dev@incubator.apache.org
Subject: Re: how do I get the multisearcher to work.

It works!

Pam

On 5/24/06, George Aroush <george@aroush.net> wrote:
>
> Hi Eyal,
>
> Are you sure replacing HashTable with HashSet will fix this problem?
>
> Pam: Did you test this code with 1.4.3 if so, did you get the same error?
>
> Thanks.
>
> -- George Aroush
>
> -----Original Message-----
> From: Eyal Post [mailto:eyalpost@epocalipse.com]
> Sent: Wednesday, May 24, 2006 4:43 PM
> To: lucene-net-dev@incubator.apache.org
> Subject: RE: how do I get the multisearcher to work.
>
> Yes, seems like what I reported for 1.9 RC1:
> http://sourceforge.net/forum/message.php?msg_id=3549420
> Is still hapenning in RC2.
>
> George, I sent you back then a hashSet implementation in c# to use 
> instead of HashTable (to make it compatible with the java version). 
> This will make the code cleaner and will solve these kind of problems 
> (dulicate keys) for good.
> Are you planning to use it?
>
> Eyal
>
> -----Original Message-----
> From: Pamela Foxcroft [mailto:pamelafoxcroft@gmail.com]
> Sent: Wednesday, May 24, 2006 19:16 PM
> To: lucene-net-dev@incubator.apache.org
> Subject: how do I get the multisearcher to work.
>
> I keep on getting this message. We are using 1.9 RC2. Item has already 
> been added. Key in dictionary: 'text:horse' Key being added: 
> 'text:horse'
>
> Here is my code - this is based on the lucene in action book.
>
>
> using System;
> using System.Collections.Generic;
> using System.Text;
> using Lucene.Net.Analysis;
> using Lucene.Net.Analysis.Standard;
> using Lucene.Net.Search;
> using Lucene.Net.QueryParsers;
> using Lucene.Net.Store;
> using Lucene.Net.Index;
> using Lucene.Net.Documents;
>
> namespace MultiSearcher
> {
>    class Program
>    {
>        static void Main(string[] args)
>        {
>            string[] animals ={
> "aardvark","beaver","coati","dog","elephant","frog","gila
> monster","horse","iguana",
>
>
> "javelina","kangaroo","lemur","moose","nematode","orca","python","quok
> ka","r
> at","scorpian","trrantula",
>                "uramstyx","vicuna","walrus","Xuphias","yak","zebra"};
>
>            Analyzer analyzer = new WhitespaceAnalyzer();
>
>            Directory aTOmDirectory = new RAMDirectory();
>            Directory nTOzDirectory = new RAMDirectory();
>
>            IndexWriter aToMWriter = new IndexWriter(aTOmDirectory, 
> analyzer, true);
>            IndexWriter nToZWriter = new IndexWriter(nTOzDirectory, 
> analyzer, true);
>
>            for (int i = 0; i < animals.Length; i++)
>            {
>                Document doc = new Document();
>                String animal = animals[i];
>
>                doc.Add(Field.Text("text",animal.ToString()));
>            if (i<10)
>            {
>                aToMWriter.AddDocument(doc);
>            }
>            else
>            {
>
>                nToZWriter.AddDocument(doc);
>            }
>
>            }
>            aToMWriter.Close();
>            nToZWriter.Close();
>
>            IndexSearcher[] searchers = new IndexSearcher[2];
>            searchers[0] = new IndexSearcher(aTOmDirectory);
>            searchers[1] = new IndexSearcher(nTOzDirectory);
>
>            MultiSearcher searcher = new MultiSearcher(searchers);
>
>            Query query = QueryParser.Parse("horse","text" , new 
> StandardAnalyzer());
>           Console.WriteLine("Query: " + query.ToString());
>            Hits hits = searcher.Search(query);  Console.Write("end");
>        }
>    }
> }
>
>
>
> thanks
>
>
>
> Pam
>
>


Mime
View raw message