Uploaded image for project: 'XWiki Platform'
  1. XWiki Platform
  2. XWIKI-16719

Add ability to retrieve a SolrDocument by its identifier

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 11.7
    • Fix Version/s: 11.8-rc-1
    • Component/s: Search - Solr
    • Labels:
      None
    • Difficulty:
      Trivial
    • Documentation:
      N/A
    • Documentation in Release Notes:
      N/A
    • Pull Request Status:
      Pull Request accepted
    • Similar issues:

      Description

      Currently, AbstractSolrInstance declares protected access to the SolrClient it contains. This prevents external services to retrieve a given SolrDocument for performing some operations on it. In the general case, it's not needed since the fields extraction process is occurs within a dedicated document extractor, and it may increase the index safety. However, in some other cases encountered for instance in application-page-relations, there's a need, when indexing a document, to also update the index of other documents. A way to implement this currently has consisted in creating a derived SolrInstance exposing the method below. This works fine, however this requires to modify "xwiki.properties" in order to configure the corresponding "solr.type", which involves restarting the server.

      This issue is about proposing the addition of the following method to AbstractSolrInstance, or any similar mechanism enabling external access to SolrDocuments:

          public SolrDocument getSolrDocument(String id) throws IOException, SolrServerException
          {
              return this.server.getById(id);
          }
      

      What do you think?

        Attachments

          Activity

            People

            • Assignee:
              slauriere slauriere
              Reporter:
              slauriere slauriere
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:
                Date of First Response: