jackrabbit-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From neman ould sidahmed <nould...@yahoo.fr>
Subject custom indexing for jackrabbit
Date Mon, 02 Mar 2009 10:08:41 GMT
Hello everybody,



I have a problem with configuration indexing for Jackrabbit, I declared my custom nodes types,

I have a node type name mynamespace:item, I would like indexing some
properties like title, autho rfor this node type  this is my
configuration : 



- repsotiroy configuration for search indexing :



<SearchIndex class="org.apache.jackrabbit.core.query.lucene.SearchIndex">

    <param name="path" value="${rep.home}/repository/index"/>

    <param name="indexingConfiguration" value="${rep.home}/jackrabbit-indexing.xml"/>

    <param name="textFilterClasses"
value="org.apache.jackrabbit.extractor.MsWordTextExtractor,org.apache.jackrabbit.extractor.MsExcelTextExtractor,org.apache.jackrabbit.extractor.MsPowerPointTextExtractor,org.apache.jackrabbit.extractor.PdfTextExtractor,org.apache.jackrabbit.extractor.OpenOfficeTextExtractor,org.apache.jackrabbit.extractor.RTFTextExtractor,org.apache.jackrabbit.extractor.HTMLTextExtractor,org.apache.jackrabbit.extractor.XMLTextExtractor"/>

    <param name="extractorPoolSize " value="2"/>

    <param name="supportHighlighting" value="true"/>

    <param name="forceConsistencyCheck" value="false"/>

    <param name="enableConsistencyCheck" value="false"/>

</SearchIndex>



- my file indexing configuration : 



<?xml version="1.0" encoding="UTF-8"?>

<!DOCTYPE configuration SYSTEM "http://jackrabbit.apache.org/dtd/indexing-configuration-1.1.dtd">

<configuration xmlns:nt="http://www.jcp.org/jcr/nt/1.0"

    xmlns:mynamespace="http://www.mydomain.fr/jcr/mynamespace"

    xmlns:jcr="http://www.jcp.org/jcr/1.0">

    

    <index-rule nodeType="mynamespace:item">

        <property boost="5.0">mynamespace:title</property>

        <property boost="1.5">mynamespace:author</property>

    </index-rule>

</configuration>



- my file nodes types configuration 

<?xml version="1.0" encoding="UTF-8"?>

<nodeTypes xmlns:fn="http://www.w3.org/2005/xpath-functions" 

    xmlns:fn_old="http://www.w3.org/2004/10/xpath-functions" 

    xmlns:jcr="http://www.jcp.org/jcr/1.0" 

    xmlns:mix="http://www.jcp.org/jcr/mix/1.0" 

    xmlns:nt="http://www.jcp.org/jcr/nt/1.0" 

    xmlns:rep="internal" 

    xmlns:mynamespace="http://www.mydomain.fr/jcr/mynamespace" 

    xmlns:sv="http://www.jcp.org/jcr/sv/1.0" 

    xmlns:xs="http://www.w3.org/2001/XMLSchema">



    <nodeType hasOrderableChildNodes="false" isMixin="false" name="mynamespace:item"
primaryItemName="">

        <supertypes>

            <supertype>mix:referenceable</supertype>

            <supertype>nt:base</supertype>

        </supertypes>

        <propertyDefinition autoCreated="false" mandatory="false"
multiple="true" name="mynamespace:author" onParentVersion="COPY"
protected="false" requiredType="String"/>

        <propertyDefinition autoCreated="false" mandatory="false"
multiple="false" name="mynamespace:title" onParentVersion="COPY"
protected="false" requiredType="String"/>

        <propertyDefinition autoCreated="false" mandatory="false"
multiple="false" name="mynamespace:subject" onParentVersion="COPY"
protected="false" requiredType="String"/>

        <propertyDefinition autoCreated="false" mandatory="true"
multiple="false" name="mynamespace:dateCreated" onParentVersion="COPY"
protected="false" requiredType="Date"/>

    </nodeType>

</nodeTypes>





for registry Namespaces : 



session.getWorkspace().getNamespaceRegistry().registerNamespace(ns, uri);

    



for Nodestypes register : 



InputStream xml = new FileInputStream(this.typesDefinition.getFile());

Workspace workspace = (Workspace) session.getWorkspace();

NodeTypeManager ntMgr = workspace.getNodeTypeManager();

NodeTypeRegistry ntReg = ((NodeTypeManagerImpl) ntMgr).getNodeTypeRegistry();

NodeTypeDef[] types = NodeTypeReader.read(xml);

for (int j = 0; j < types.length; j++) {

    NodeTypeDef def = types[j];

    try {

    ntReg.getNodeTypeDef(def.getName());

    }

    catch (NoSuchNodeTypeException nsne) {

    logger.info("Registering node "+def.getName());

    // HINT: if not already registered than register custom node type

    ntReg.registerNodeType(def);

    }

}



if I delete my file indexing configuration this work else if I update
the item for type mynamespace:item I can't get it it deleted from index, please, can any one
tell me why?



regards



nould


      
Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message