Skip to content

Disabling Query Rewrites

Eliza Margaretha Illig edited this page Dec 4, 2024 · 2 revisions

Kustvakt full version includes some query rewrites that may not be relevant for systems other than KorAP. The query rewrites can be disabled in the spring configuration file.

Copy /src/main/resources/default-config.xml to the data folder.

Go to the lines populating the query rewrites as shown below.

<!-- Rewrite -->
<bean id="foundryRewrite" class="de.ids_mannheim.korap.rewrite.FoundryRewrite"/>
<bean id="collectionRewrite" class="de.ids_mannheim.korap.rewrite.CollectionRewrite"/>
<bean id="virtualCorpusRewrite" class="de.ids_mannheim.korap.rewrite.VirtualCorpusRewrite"/>
<bean id="queryReferenceRewrite" class="de.ids_mannheim.korap.rewrite.QueryReferenceRewrite"/>
	
<util:list id="rewriteTasks" value-type="de.ids_mannheim.korap.rewrite.RewriteTask">
  <ref bean="foundryRewrite" />
  <ref bean="collectionRewrite" />
  <ref bean="virtualCorpusRewrite" />
  <ref bean="queryReferenceRewrite" />
</util:list>

Comment the bean and the reference of the query rewrite to disable. For instance, to disable collectionRewrite, the bean with id="collectionRewrite" and ref bean="collectionRewrite" should be commented.

Collection rewrite manages rewrites on virtual corpora by using availability regex in kustvakt.conf, which should also be commented.

## availability regex
## only support |
# availability.regex.free = CC-BY.*
# availability.regex.public = ACA.*|QAO.NC
# availability.regex.all = QAO.*
Clone this wiki locally