lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Digy" <>
Subject RE: How can I read Lucene catalogs created by the Java version of lucene?
Date Tue, 17 Jul 2007 18:39:01 GMT
Hi Pamela,

The error message you get is not clear. 

Is it possible that your index is corrupt? Because Index created with Java
Lucene is compatible with the Lucene.Net(except compressed fields and


-----Original Message-----
From: Pamela Foxcroft [] 
Sent: Tuesday, July 17, 2007 8:36 PM
Subject: How can I read Lucene catalogs created by the Java version of

I am using the 2.1 version.

I keep on getting the message \\ServerName\JavaLucene\_l1v.fnm'

and the Java index does not have any files with this name.

Here is my code.

using System;

using System.Collections.Generic;

using System.Text;

using Lucene.Net;

using Lucene.Net.Search;

using Lucene.Net.QueryParsers;

using Lucene.Net.Analysis;

using Lucene.Net.Documents;

using Lucene.Net.Index;

namespace Search


class Program


static void Main(string[] args)


string SearchPhrase ="lucene";

Searchable [] remoteSearch = new Searchable[1];

IndexSearcher remoteSearch1 = new IndexSearcher("//");

//IndexSearcher remoteSearch2 = new IndexSearcher("//");

remoteSearch[0] = remoteSearch1;

//remoteSearch[1] = remoteSearch1;

ParallelMultiSearcher msearch1 = new ParallelMultiSearcher(remoteSearch);

QueryParser qp = new QueryParser("Contents", new

Query query = qp.Parse(SearchPhrase);

QueryParser parser= new QueryParser("Contents", new WhitespaceAnalyzer());

Query q =parser.Parse(SearchPhrase);

SortField sort2 = new SortField("PostDate",SortField.STRING,true);

Sort sort = new Sort(sort2);

WhitespaceAnalyzer analyzer= new WhitespaceAnalyzer();

int postid;

string partitionid;

DateTime start = DateTime.Now;

Hits hits= msearch1.Search(q,sort);

TimeSpan duration = DateTime.Now.Subtract(start);

int total = hits.Length();

Document doc = new Document();

int PostID;

for (int a=0; a < total; a++)



PostID = int.Parse(doc.Get("PostID").Trim());







View raw message