Skip to content
Snippets Groups Projects
Commit fd91b4fd authored by Thomas Mortagne's avatar Thomas Mortagne
Browse files

XCOMMONS-2341: Add installed extensions to the extensions index

parent d16bcb04
No related branches found
No related tags found
No related merge requests found
......@@ -27,6 +27,7 @@
import org.xwiki.component.annotation.Component;
import org.xwiki.extension.DefaultExtensionComponent;
import org.xwiki.extension.Extension;
import org.xwiki.extension.InstalledExtension;
import org.xwiki.extension.RemoteExtension;
import org.xwiki.extension.rating.RatingExtension;
import org.xwiki.search.solr.AbstractSolrCoreInitializer;
......@@ -85,13 +86,6 @@ public class ExtensionIndexSolrCoreInitializer extends AbstractSolrCoreInitializ
*/
public static final String SOLR_FIELD_INCOMPATIBLE_NAMESPACES = "s_incompatibleNamespaces";
/**
* The name of the field indicating in which namespaces an extension is installed.
*
* @since 14.0RC1
*/
public static final String SOLR_FIELD_INSTALLED_NAMESPACES = "s_installedNamespaces";
/**
* The name of the field indicating if an entry is the last version of an extension.
*/
......@@ -175,7 +169,7 @@ protected void migrateSchema(long cversion) throws SolrException
}
if (cversion < SCHEMA_VERSION_14_0) {
setStringField(SOLR_FIELD_INSTALLED_NAMESPACES, true, false);
setStringField(InstalledExtension.FIELD_INSTALLED_NAMESPACES, true, false);
}
}
......
......@@ -353,7 +353,7 @@ public void updateInstalled(ExtensionId extensionId, String namespace, boolean i
// Update installed
this.utils.setAtomic(
installed ? SolrUtils.ATOMIC_UPDATE_MODIFIER_ADD_DISTINCT : SolrUtils.ATOMIC_UPDATE_MODIFIER_REMOVE,
ExtensionIndexSolrCoreInitializer.SOLR_FIELD_INSTALLED_NAMESPACES, toStoredNamespace(namespace), document);
InstalledExtension.FIELD_INSTALLED_NAMESPACES, toStoredNamespace(namespace), document);
// Update compatible
if (installed) {
......@@ -736,7 +736,7 @@ public IterableResult<Extension> search(ExtensionQuery query) throws SearchExcep
if (!indexedQuery.getInstalled()) {
builder.append('-');
}
builder.append(ExtensionIndexSolrCoreInitializer.SOLR_FIELD_INSTALLED_NAMESPACES);
builder.append(InstalledExtension.FIELD_INSTALLED_NAMESPACES);
builder.append(':');
builder.append('(');
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment