You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucenenet.apache.org by "Doug Sale (JIRA)" <ji...@apache.org> on 2008/07/23 17:03:31 UTC

[jira] Created: (LUCENENET-138) IndexReader.IndexExists() always returns false

IndexReader.IndexExists() always returns false
----------------------------------------------

                 Key: LUCENENET-138
                 URL: https://issues.apache.org/jira/browse/LUCENENET-138
             Project: Lucene.Net
          Issue Type: Bug
            Reporter: Doug Sale




-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (LUCENENET-138) IndexReader.IndexExists() always returns false

Posted by "George Aroush (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

George Aroush closed LUCENENET-138.
-----------------------------------


Applied patch and delivered.

> IndexReader.IndexExists() always returns false
> ----------------------------------------------
>
>                 Key: LUCENENET-138
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-138
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Doug Sale
>         Attachments: SegmentInfos.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (LUCENENET-138) IndexReader.IndexExists() always returns false

Posted by "Doug Sale (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Sale updated LUCENENET-138:
--------------------------------

    Attachment: SegmentInfos.patch

Only 1 line needs to change.  However, this patch contains changes included in an earlier patch from Digy.

> IndexReader.IndexExists() always returns false
> ----------------------------------------------
>
>                 Key: LUCENENET-138
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-138
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Doug Sale
>         Attachments: SegmentInfos.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (LUCENENET-138) IndexReader.IndexExists() always returns false

Posted by "Doug Sale (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/LUCENENET-138?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Doug Sale resolved LUCENENET-138.
---------------------------------

    Resolution: Fixed

In the code below (from IndexReader.cs), when the passed-in array of files contains path information, the test matching the start of the filename fails.

                public static long GetCurrentSegmentGeneration(System.String[] files)
		{
			if (files == null)
			{
				return - 1;
			}
			long max = - 1;
			for (int i = 0; i < files.Length; i++)
			{
				System.String file = files[i];
				if (file.StartsWith(IndexFileNames.SEGMENTS) && !file.Equals(IndexFileNames.SEGMENTS_GEN))
				{
					long gen = GenerationFromSegmentsFileName(file);
					if (gen > max)
					{
						max = gen;
					}
				}
			}
			return max;
		}

The fix is to change the following line:
				System.String file = files[i];
to:
				System.String file = System.IO.Path.GetFileName(files[i]);


> IndexReader.IndexExists() always returns false
> ----------------------------------------------
>
>                 Key: LUCENENET-138
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-138
>             Project: Lucene.Net
>          Issue Type: Bug
>            Reporter: Doug Sale
>         Attachments: SegmentInfos.patch
>
>   Original Estimate: 0h
>  Remaining Estimate: 0h
>


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.