Thanks, Mark. I created SOLR-4413 [1] for it.

I'm not sure what the best fix is since it looks like a lot of the work at
that time went into refactoring SolrIndexSearcher to use DirectoryFactory
everywhere and index.properties doesn't make much sense when an FSDirectory
is not used...

Anyway, I'll follow up in JIRA.

--Gregg

[1] https://issues.apache.org/jira/browse/SOLR-4413

On Wed, Feb 6, 2013 at 8:42 PM, Mark Miller <markrmil...@gmail.com> wrote:

> Thanks Gregg - can you file a JIRA issue?
>
> - Mark
>
> On Feb 6, 2013, at 5:57 PM, Gregg Donovan <gregg...@gmail.com> wrote:
>
> > Mark-
> >
> > You're right that SolrCore#getIndexDir() did not directly read
> > index.properties in 3.6. In 3.6, it gets it indirectly from what is
> passed
> > to the constructor of SolrIndexSearcher. Here's SolrCore#getIndexDir() in
> > 3.6:
> >
> >  public String getIndexDir() {
> >    synchronized (searcherLock) {
> >      if (_searcher == null)
> >        return dataDir + "index/";
> >      SolrIndexSearcher searcher = _searcher.get();
> >      return searcher.getIndexDir() == null ? dataDir + "index/" :
> > searcher.getIndexDir();
> >    }
> >  }
> >
> > In 3.6 the only time I see a new SolrIndexSearcher created without the
> > results of SolrCore#getNewIndexDir() getting passed in somehow would be
> if
> > SolrCore#newSearcher(String, boolean) is called manually before any other
> > SolrIndexSearcher. Otherwise, it looks like getNewIndexDir() is getting
> > passed to new SolrIndexSearcher which is then reflected back
> > in SolrCore#getIndexDir().
> >
> > So, in 3.6 we had been able to rely on SolrCore#getIndexDir() giving us
> > either the value the index referenced in index.properties OR dataDir +
> > "index/" if index.properties was missing. In 4.1, it always gives us
> > dataDir + "index/".
> >
> > Here's the comment in 3.6 on SolrCore#getNewIndexDir() that I think you
> > were referring to. The comment is unchanged in 4.1:
> >
> >  /**
> >   * Returns the indexdir as given in index.properties. If
> index.properties
> > exists in dataDir and
> >   * there is a property <i>index</i> available and it points to a valid
> > directory
> >   * in dataDir that is returned Else dataDir/index is returned. Only
> > called for creating new indexSearchers
> >   * and indexwriters. Use the getIndexDir() method to know the active
> > index directory
> >   *
> >   * @return the indexdir as given in index.properties
> >   */
> >  public String getNewIndexDir() {
> >
> > *"Use the getIndexDir() method to know the active index directory"* is
> the
> > behavior that we were reliant on. Since it's now hardcoded to dataDir +
> > "index/", it doesn't always return the active index directory.
> >
> > --Gregg
> >
> > On Wed, Feb 6, 2013 at 5:13 PM, Mark Miller <markrmil...@gmail.com>
> wrote:
> >
> >>
> >> On Feb 6, 2013, at 4:23 PM, Gregg Donovan <gregg...@gmail.com> wrote:
> >>
> >>> code we had that relied on the 3.6 behavior of SolrCore#getIndexDir()
> is
> >>> not working the same way.
> >>
> >> Can you be very specific about the different behavior that you are
> seeing?
> >> What exactly where you seeing and counting on and what are you seeing
> now?
> >>
> >> - Mark
>
>

Reply via email to