lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neils <ne...@gmx.net>
Subject Re: Part of Index (spezial Field) into Memory
Date Wed, 19 Jul 2006 10:07:18 GMT

Hi,

ok, i tried today and it works greate :-) Thanks a lot for your help.

...one question at least... Is sorting not possible with this
Parallelreader? I get an error. Here my code:

  Private Sub LoadParallelIndex()
        Ram = New Lucene.Net.Store.RAMDirectory("C:\Lucene\index0_Name")
        pr = New ParallelReader
        pr.Add(IndexReader.Open(Ram))
        pr.Add(IndexReader.Open("C:\Lucene\index0_Address"))
        pr.Add(IndexReader.Open("C:\Lucene\index0_Locality"))
        pr.Add(IndexReader.Open("C:\Lucene\index0_Phonenumbers"))
        searcher = New IndexSearcher(pr)
        Me.TextBox2.Text += "Added all indexes to ParallelReader" +
vbNewLine
    End Sub

    Private Sub ParallelSearch(ByVal q As String)
        Dim field As SortField = New SortField("Nachname", SortField.STRING,
True)
        Dim sortByName As Sort = New Sort(field)
        Dim query As Query = QueryParser.Parse(q, "Nachname", New
StandardAnalyzer)
        Dim hits As Hits = searcher.Search(query, sortByName)
        Me.TextBox2.Text = ("Found " + hits.Length().ToString + "
document(s) that matched query '" + q + vbNewLine)
        Me.Refresh()

        Dim numHits = hits.Length
        If numHits > 250 Then
            numHits = 250
        End If

        For i As Integer = 0 To numHits - 1
            Dim doc As Document = hits.Doc(i)
            Me.TextBox2.Text += (i + 1).ToString + ".) " +
doc.Get("Nachname").ToString + ", " + doc.Get("Postleitzahl").ToString + " "
+ doc.Get("Postort").ToString + ", " + doc.Get("Vorwahl").ToString + "-" +
doc.Get("Rufnummer").ToString + vbNewLine
        Next

    End Sub


Can you take a look at it ?

Thanks,
Neils
-- 
View this message in context: http://www.nabble.com/Part-of-Index-%28spezial-Field%29-into-Memory-tf1955582.html#a5393608
Sent from the Lucene - Java Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: java-user-unsubscribe@lucene.apache.org
For additional commands, e-mail: java-user-help@lucene.apache.org


Mime
View raw message