Hello,

I was looking into "QueryElevationComponent" component.

As per the spec (http://wiki.apache.org/solr/QueryElevationComponent), if
config is not found in zookeepr, it should be loaded from data directory.
However, I see the bug. It doesn't seem to be working even in latest 4.7.2
release.

I have checked the latest code and found this:
Map<String, ElevationObj> getElevationMap(IndexReader reader, SolrCore
core) throws Exception {
    synchronized (elevationCache) {
      Map<String, ElevationObj> map = elevationCache.get(null);
      if (map != null) return map;

      map = elevationCache.get(reader);
      if (map == null) {
        String f = initArgs.get(CONFIG_FILE);
        if (f == null) {
          throw new SolrException(SolrException.ErrorCode.SERVER_ERROR,
              "QueryElevationComponent must specify argument: " +
CONFIG_FILE);
        }
        log.info("Loading QueryElevation from data dir: " + f);

        Config cfg;

        ZkController zkController =
core.getCoreDescriptor().getCoreContainer().getZkController();
        if (zkController != null) {
          cfg = new Config(core.getResourceLoader(), f, null, null);
        } else {
          InputStream is = VersionedFile.getLatestFile(core.getDataDir(),
f);
          cfg = new Config(core.getResourceLoader(), f, new
InputSource(is), null);
        }

        map = loadElevationMap(cfg);
        elevationCache.put(reader, map);
      }
      return map;
    }
  }

As per this code, we will never be able to load config from data directory
if zookeepr exists.

Can we fix this issue?

Thanks,
Ronak

Reply via email to