How to get a geometry from a COLLADA (.dae) file with SceneKit - geometry

I need to read the <geometry> in a COLLADA file in order to create the array of morph targets and animate the mesh from the base geometry to the target geometries.
I can only access the geometry from the base geometry that's embedded in the Node (the COLLADA file only have one <node>):
planeNode.geometry = scene!.rootNode.childNodeWithName("Plane", recursively: true)!.geometry
Here's the full source code of the COLLADA file (have 3 geometries and 1 node but only get access to 1 geometry):
<?xml version="1.0" encoding="utf-8"?>
<COLLADA xmlns="http://www.collada.org/2005/11/COLLADASchema" version="1.4.1">
<asset>
<contributor>
<author>Blender User</author>
<authoring_tool>Blender 2.77.0 commit date:2016-04-05, commit time:18:12, hash:abf6f08</authoring_tool>
</contributor>
<unit name="meter" meter="1"/>
<up_axis>Z_UP</up_axis>
</asset>
<library_images/>
<library_geometries>
<geometry id="Plane-mesh" name="Plane">
<mesh>
<source id="Plane-mesh-positions">
<float_array id="Plane-mesh-positions-array" count="12">-1 -1 0 1 -1 0 -1 1 0 1 1 0</float_array>
<technique_common>
<accessor source="#Plane-mesh-positions-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane-mesh-normals">
<float_array id="Plane-mesh-normals-array" count="3">0 0 1</float_array>
<technique_common>
<accessor source="#Plane-mesh-normals-array" count="1" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Plane-mesh-vertices">
<input semantic="POSITION" source="#Plane-mesh-positions"/>
</vertices>
<polylist count="2">
<input semantic="VERTEX" source="#Plane-mesh-vertices" offset="0"/>
<input semantic="NORMAL" source="#Plane-mesh-normals" offset="1"/>
<vcount>3 3 </vcount>
<p>1 0 2 0 0 0 1 0 3 0 2 0</p>
</polylist>
</mesh>
</geometry>
<geometry id="Plane-mesh_morph_Key1" name="Key1">
<mesh>
<source id="Plane-mesh_morph_Key1-positions">
<float_array id="Plane-mesh_morph_Key1-positions-array" count="12">-1 -1 0 1 -1 0 -1 1 0 1 2 0</float_array>
<technique_common>
<accessor source="#Plane-mesh_morph_Key1-positions-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane-mesh_morph_Key1-normals">
<float_array id="Plane-mesh_morph_Key1-normals-array" count="6">0 0 1 0 0 1</float_array>
<technique_common>
<accessor source="#Plane-mesh_morph_Key1-normals-array" count="2" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Plane-mesh_morph_Key1-vertices">
<input semantic="POSITION" source="#Plane-mesh_morph_Key1-positions"/>
</vertices>
<polylist count="2">
<input semantic="VERTEX" source="#Plane-mesh_morph_Key1-vertices" offset="0"/>
<input semantic="NORMAL" source="#Plane-mesh_morph_Key1-normals" offset="1"/>
<vcount>3 3 </vcount>
<p>1 0 2 0 0 0 1 1 3 1 2 1</p>
</polylist>
</mesh>
</geometry>
<geometry id="Plane-mesh_morph_Key2" name="Key2">
<mesh>
<source id="Plane-mesh_morph_Key2-positions">
<float_array id="Plane-mesh_morph_Key2-positions-array" count="12">-1 -1 0 1 -1 0 -1 1 0 2 1 0</float_array>
<technique_common>
<accessor source="#Plane-mesh_morph_Key2-positions-array" count="4" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<source id="Plane-mesh_morph_Key2-normals">
<float_array id="Plane-mesh_morph_Key2-normals-array" count="3">0 0 1</float_array>
<technique_common>
<accessor source="#Plane-mesh_morph_Key2-normals-array" count="1" stride="3">
<param name="X" type="float"/>
<param name="Y" type="float"/>
<param name="Z" type="float"/>
</accessor>
</technique_common>
</source>
<vertices id="Plane-mesh_morph_Key2-vertices">
<input semantic="POSITION" source="#Plane-mesh_morph_Key2-positions"/>
</vertices>
<polylist count="2">
<input semantic="VERTEX" source="#Plane-mesh_morph_Key2-vertices" offset="0"/>
<input semantic="NORMAL" source="#Plane-mesh_morph_Key2-normals" offset="1"/>
<vcount>3 3 </vcount>
<p>1 0 2 0 0 0 1 0 3 0 2 0</p>
</polylist>
</mesh>
</geometry>
</library_geometries>
<library_controllers>
<controller id="Plane-morph" name="Plane-morph">
<morph source="#Plane-mesh" method="NORMALIZED">
<source id="Plane-targets">
<IDREF_array id="Plane-targets-array" count="2">Plane-mesh_morph_Key1 Plane-mesh_morph_Key2</IDREF_array>
<technique_common>
<accessor source="#Plane-targets-array" count="2" stride="1">
<param name="IDREF" type="IDREF"/>
</accessor>
</technique_common>
</source>
<source id="Plane-weights">
<float_array id="Plane-weights-array" count="2">0 0</float_array>
<technique_common>
<accessor source="#Plane-weights-array" count="2" stride="1">
<param name="MORPH_WEIGHT" type="float"/>
</accessor>
</technique_common>
</source>
<targets>
<input semantic="MORPH_TARGET" source="#Plane-targets"/>
<input semantic="MORPH_WEIGHT" source="#Plane-weights"/>
</targets>
</morph>
</controller>
</library_controllers>
<library_visual_scenes>
<visual_scene id="Scene" name="Scene">
<node id="Plane" name="Plane" type="NODE">
<matrix sid="transform">1 0 0 0 0 -4.37114e-8 -1 0 0 1 -4.37114e-8 0 0 0 0 1</matrix>
<instance_geometry url="#Plane-mesh" name="Plane"/>
</node>
</visual_scene>
</library_visual_scenes>
<scene>
<instance_visual_scene url="#Scene"/>
</scene>
</COLLADA>
Any help is appreciated. Thanks!

you can use entryWithIdentifier:withClass: to retrieve objects that are not in the scene graph. Alternatively, in your authoring tool, you can attach the morpher to a node and then use the morpher property of a node to retrieve its target geometries.

Related

Liferay Service Builder Table Auto Increment On Each Deployment

In liferay i have a entity as below:
<entity name="Foo" local-service="true" remote-service="true">
<!-- PK fields -->
<column name="fooId" type="long" primary="true" />
<!-- Group instance -->
<column name="groupId" type="long" />
<!-- Audit fields -->
<column name="companyId" type="long" />
<column name="userId" type="long" />
<column name="userName" type="String" />
<column name="createDate" type="Date" />
<column name="modifiedDate" type="Date" />
<!-- Other fields -->
<column name="field1" type="String" />
<column name="field2" type="boolean" />
<column name="field3" type="int" />
<column name="field4" type="Date" />
<column name="field5" type="String" />
<!-- Order -->
<order by="asc">
<order-column name="field1" />
</order>
<!-- Finder methods -->
<finder name="Field2" return-type="Collection">
<finder-column name="field2" />
</finder>
</entity>
When i change the code of the portlet. On each deployment its primary key increases by 100.
So there is anyway to set it auto increment by 1 only. And it must not be incremented by 100 on each deploy.
Option#1
Add this in your primary key column id-type="increment"
i.e
<column name="fooId" type="long" primary="true" id-type="increment" />
Cons:
This WILL BREAK IN CLUSTERED Environment
Option#2
add this in portal-ext.properties
#
# Set the number of increments between database updates to the Counter
# table. Set this value to a higher number for better performance.
#
counter.increment=1 //by default it is 100
Cons: this will impact your performance.

Get the attributes name with highest value in RapidMiner

I want to generate a new attribute where the attribute name(s) that has highest value is stored. My goal is similar like this question (Returning the column header of max value on per row basis).
It's quite complicated and involves transposing each example within an example set, sorting to find the maximum, extracting the name of the attribute into a macro and setting this value into the original example set.
Here's a process that you can copy.
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<process version="6.5.000">
<context>
<input/>
<output/>
<macros/>
</context>
<operator activated="true" class="process" compatibility="6.5.000" expanded="true" name="Process">
<parameter key="logverbosity" value="init"/>
<parameter key="random_seed" value="2001"/>
<parameter key="send_mail" value="never"/>
<parameter key="notification_email" value=""/>
<parameter key="process_duration_for_mail" value="30"/>
<parameter key="encoding" value="SYSTEM"/>
<parameter key="parallelize_main_process" value="false"/>
<process expanded="true">
<operator activated="true" class="generate_data" compatibility="6.5.000" expanded="true" height="60" name="Generate Data" width="90" x="112" y="75">
<parameter key="target_function" value="random"/>
<parameter key="number_examples" value="100"/>
<parameter key="number_of_attributes" value="5"/>
<parameter key="attributes_lower_bound" value="-10.0"/>
<parameter key="attributes_upper_bound" value="10.0"/>
<parameter key="use_local_random_seed" value="false"/>
<parameter key="local_random_seed" value="1992"/>
<parameter key="datamanagement" value="double_array"/>
</operator>
<operator activated="true" class="generate_attributes" compatibility="6.5.000" expanded="true" height="76" name="Generate Attributes" width="90" x="246" y="75">
<list key="function_descriptions">
<parameter key="maximum" value=""unknown""/>
</list>
<parameter key="keep_all" value="true"/>
</operator>
<operator activated="true" class="loop_examples" compatibility="6.5.000" expanded="true" height="76" name="Loop Examples" width="90" x="380" y="75">
<parameter key="iteration_macro" value="example"/>
<parameter key="parallelize_example_process" value="false"/>
<process expanded="true">
<operator activated="true" class="filter_example_range" compatibility="6.5.000" expanded="true" height="76" name="Filter Example Range" width="90" x="112" y="30">
<parameter key="first_example" value="%{example}"/>
<parameter key="last_example" value="%{example}"/>
<parameter key="invert_filter" value="false"/>
</operator>
<operator activated="true" class="select_attributes" compatibility="6.5.000" expanded="true" height="76" name="Select Attributes" width="90" x="112" y="165">
<parameter key="attribute_filter_type" value="subset"/>
<parameter key="attribute" value=""/>
<parameter key="attributes" value="id|label|maximum"/>
<parameter key="use_except_expression" value="false"/>
<parameter key="value_type" value="attribute_value"/>
<parameter key="use_value_type_exception" value="false"/>
<parameter key="except_value_type" value="time"/>
<parameter key="block_type" value="attribute_block"/>
<parameter key="use_block_type_exception" value="false"/>
<parameter key="except_block_type" value="value_matrix_row_start"/>
<parameter key="invert_selection" value="true"/>
<parameter key="include_special_attributes" value="true"/>
</operator>
<operator activated="true" class="transpose" compatibility="6.5.000" expanded="true" height="76" name="Transpose" width="90" x="246" y="165"/>
<operator activated="true" class="sort" compatibility="6.5.000" expanded="true" height="76" name="Sort" width="90" x="380" y="165">
<parameter key="attribute_name" value="att_1"/>
<parameter key="sorting_direction" value="decreasing"/>
</operator>
<operator activated="true" class="extract_macro" compatibility="6.5.000" expanded="true" height="60" name="Extract Macro" width="90" x="514" y="165">
<parameter key="macro" value="max"/>
<parameter key="macro_type" value="data_value"/>
<parameter key="statistics" value="average"/>
<parameter key="attribute_name" value="id"/>
<parameter key="example_index" value="1"/>
<list key="additional_macros"/>
</operator>
<operator activated="true" class="subprocess" compatibility="6.5.000" expanded="true" height="94" name="Subprocess" width="90" x="648" y="30">
<parameter key="parallelize_nested_process" value="false"/>
<process expanded="true">
<connect from_port="in 1" to_port="out 1"/>
<portSpacing port="source_in 1" spacing="0"/>
<portSpacing port="source_in 2" spacing="0"/>
<portSpacing port="source_in 3" spacing="0"/>
<portSpacing port="sink_out 1" spacing="0"/>
<portSpacing port="sink_out 2" spacing="0"/>
</process>
</operator>
<operator activated="true" class="set_data" compatibility="6.5.000" expanded="true" height="76" name="Set Data" width="90" x="782" y="30">
<parameter key="example_index" value="%{example}"/>
<parameter key="count_backwards" value="false"/>
<parameter key="attribute_name" value="maximum"/>
<parameter key="value" value="%{max}"/>
<list key="additional_values"/>
</operator>
<connect from_port="example set" to_op="Filter Example Range" to_port="example set input"/>
<connect from_op="Filter Example Range" from_port="example set output" to_op="Select Attributes" to_port="example set input"/>
<connect from_op="Filter Example Range" from_port="original" to_op="Subprocess" to_port="in 1"/>
<connect from_op="Select Attributes" from_port="example set output" to_op="Transpose" to_port="example set input"/>
<connect from_op="Transpose" from_port="example set output" to_op="Sort" to_port="example set input"/>
<connect from_op="Sort" from_port="example set output" to_op="Extract Macro" to_port="example set"/>
<connect from_op="Extract Macro" from_port="example set" to_op="Subprocess" to_port="in 2"/>
<connect from_op="Subprocess" from_port="out 1" to_op="Set Data" to_port="example set input"/>
<connect from_op="Set Data" from_port="example set output" to_port="example set"/>
<portSpacing port="source_example set" spacing="0"/>
<portSpacing port="sink_example set" spacing="0"/>
<portSpacing port="sink_output 1" spacing="0"/>
</process>
</operator>
<connect from_op="Generate Data" from_port="output" to_op="Generate Attributes" to_port="example set input"/>
<connect from_op="Generate Attributes" from_port="example set output" to_op="Loop Examples" to_port="example set"/>
<connect from_op="Loop Examples" from_port="example set" to_port="result 1"/>
<portSpacing port="source_input 1" spacing="0"/>
<portSpacing port="sink_result 1" spacing="0"/>
<portSpacing port="sink_result 2" spacing="0"/>
</process>
</operator>
</process>

FetchXML View to Include Attributes from Nested Link-Entity

I would like to have a view that show attributes from 3 entities:
Statistics has a lookup to Account and Account has a lookup to Address.
The view is on Statistics and I want attributes from all 3 entities; is this even possible?
The problem is with the GridXML.
I want to include the attribute wl_city in the GridXML.
This is the FetchXML with link-entities:
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="sb_statistics">
<order attribute="sb_amount" descending="false" />
<!-- It is easy to get these into the GridXML -->
<attribute name="sb_debtor" />
<attribute name="sb_date" />
<attribute name="sb_amount" />
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<!-- It is possible to get this into the GridXML
by using the link-entity alias: relatedAccount.wl_towncity -->
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="outer">
<!-- I have trouble getting this attribute into the GridXML -->
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
</fetch>
</fetchxml>
When I change the GridXML as below this error is displayed when the view is opened:
"To use this saved query, you must remove criteria and columns that refer to deleted or non-searchable items"
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAccount.relatedAddress.wl_city" width="100" />
</row>
</grid>
</layoutxml>
The below GridXML shows this error when the view is opened:
"Unexpected Error An error has occured".
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAddress.wl_city" width="100" />
</row>
</grid>
</layoutxml>
The GridXML below results in this error being shown when the view is opened:
"To use this saved view, you must remove criteria and columns that refer to deleted or non-searchable columns".
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="wl_city" width="100" />
</row>
</grid>
</layoutxml>
This saved query works, but it only includes attributes from the primary entity and the first link-entity.
<savedquery>
<IsCustomizable>1</IsCustomizable>
<CanBeDeleted>0</CanBeDeleted>
<isquickfindquery>0</isquickfindquery>
<isprivate>0</isprivate>
<isdefault>0</isdefault>
<returnedtypecode>10008</returnedtypecode>
<savedqueryid>{df101ac4-2e4d-e311-9377-005056bd0001}</savedqueryid>
<layoutxml>
<grid name="resultset" object="10008" jump="sb_name" select="1" preview="1"
icon="1">
<row name="result" id="sb_statisticsid" multiobjectidfield="1">
<cell name="sb_amount" width="100" />
<cell name="sb_date" width="100" />
<cell name="sb_debtor" width="100" />
<cell name="relatedAccount.wl_city" width="100" />
</row>
</grid>
</layoutxml>
<querytype>0</querytype>
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="sb_statistics">
<order attribute="sb_amount" descending="false" />
<attribute name="sb_debtor" />
<attribute name="sb_date" />
<attribute name="sb_amount" />
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="outer">
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
</fetch>
</fetchxml>
<LocalizedNames>
<LocalizedName description="Statistics and Address" languagecode="1033" />
</LocalizedNames>
</savedquery>
Is GridXML limited to showing only attributes from the primary entity and the first link-entity?
This is not possible, according to the best of my knowledge, but please someone prove me wrong.
A limitation of GridXML appears to be that attributes can only be included that are from the first link-entity, not any nested link-entities.
It should work when using link-type="inner" for nested link.
<entity name="sb_statistics">
...
<link-entity name="account" from="accountid" to="sb_debtor"
alias="relatedAccount" link-type="outer">
<attribute name="wl_towncity" />
<link-entity name="wl_postalcode" from="wl_postalcodeid"
to="wl_postaltowncity" alias="relatedAddress" link-type="inner"> //link-type="inner"
<attribute name="wl_city" />
</link-entity>
</link-entity>
<attribute name="sb_statisticsid" />
</entity>
I have found no evidence that it can be done. With or without link-type='inner' the designer (in 2013) says, "The relatedAddress.wl_city column is no longer a valid column because it has been deleted as a column option. You need to remove this column and, if you want, add a different one."
It does NOT need multiple dereferrences, nor does that work. If you dump the keyValuePairs of the AttributeCollection returned by the fetch, you will see the key is relatedAddress.w1_city -- not its parent nor the combination.
Like the UI, it just appears the layout is limited to only root and children, no grandchildren nor further descendants.
I think it's a little late to answer this question, but maybe someone come to this post and find it helpful.
first thing you should know is that, fetchxml will return only column that are not null, so if you are querying a column that there is no data in that, then fetchxml automatically remove it from result set.
second thing is, if you have different table with different relationship, then alias name will be added to the column name, so in your case relatedAccount.wl_towncity and relatedAddress.wl_city is correct and not relatedAccount.relatedAddress.wl_city. in your example, you put alias name after each other that is not correct.
third thing that you should know is that when a nested result will return, the type is object, but original type AliasedValue , so first you have to cast the object to AliasedValue. then it become ready to cast it to OptionSetValue. after that you have to look for .Value that has the result of what you want
I made it work like this: I still have an issue with unresolved columnheaders.
<fetch distinct='true'>
<entity name='rdiac_riskobject'>
<attribute name='rdiac_riskobjectid' />
<attribute name='rdiac_name' />
<attribute name='rdiac_riskobjectproduct' />
<link-entity name='rdiac_riskobject_rdiac_propertydetail' from='rdiac_riskobjectid' to='rdiac_riskobjectid' intersect='true'>
<link-entity name='rdiac_propertydetail' alias='pd1' from='rdiac_propertydetailid' to='rdiac_propertydetailid'>
<attribute name='rdiac_valuestring' />
<link-entity name='rdiac_propertysvconfig' from='rdiac_property' to='rdiac_propertyid'>
<filter>
<condition attribute='rdiac_svfield' operator='eq' value='100000000'/>
</filter>
</link-entity>
</link-entity>
</link-entity>
<link-entity name='rdiac_riskobject_rdiac_propertydetail' from='rdiac_riskobjectid' to='rdiac_riskobjectid' intersect='true'>
<link-entity name='rdiac_propertydetail' alias='pd2' from='rdiac_propertydetailid' to='rdiac_propertydetailid'>
<attribute name='rdiac_valuestring' />
<link-entity name='rdiac_propertysvconfig' from='rdiac_property' to='rdiac_propertyid'>
<filter>
<condition attribute='rdiac_svfield' operator='eq' value='100000001'/>
</filter>
</link-entity>
</link-entity>
</link-entity>
</entity>
</fetch>
<grid name='resultset' object='10139' jump='rdiac_riskobjectproduct' select='1' preview='0' icon='1' >
<row name='result' id='rdiac_riskobjectid' >
<cell name='rdiac_riskobjectproduct' width='100' />
<cell name='pd1.rdiac_valuestring' width='200' />
<cell name='pd2.rdiac_valuestring' width='200' />
</row>
</grid>

Lucene index creation is not working

I am trying to create an index based through Lucene in Sitecore 6.5 through App.Config on one of the content item template. Remember the 'master' listed here is the SC DB not the physical SQL DB.
Here is my code:
<configuration xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<databases>
<database id="master" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
<Engines.HistoryEngine.Storage>
<obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel">
<param connectionStringName="$(id)" />
<EntryLifeTime>30.00:00:00</EntryLifeTime>
</obj>
</Engines.HistoryEngine.Storage>
<Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>
</database>
</databases>
<search>
<configuration>
<indexes>
<index id="master" type="Sitecore.Search.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<param desc="folder">master</param>
<Analyzer ref="search/analyzer" />
<locations hint="list:AddCrawler">
<master type="Sitecore.SharedSource.Search.Crawlers.AdvancedDatabaseCrawler,Sitecore.SharedSource.Search">
<Database>master</Database>
<Root>/sitecore/content/Data</Root>
<IndexAllFields>false</IndexAllFields>
<include hint="list:IncludeTemplate">
<template1>{EF11A8D0-D373-4A4B-90BA-16984D277612}</template1>
</include>
<fieldCrawlers hint="raw:AddFieldCrawlers">
<fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.LookupFieldCrawler,Sitecore.SharedSource.Search" fieldType="Single-Line Text" />
<fieldCrawler type="Sitecore.SharedSource.Search.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.Search" fieldType="Multilist" />
</fieldCrawlers>
<!-- If a field type is not defined, defaults of storageType="NO", indexType="UN_TOKENIZED" vectorType="NO" boost="1f" are applied-->
<fieldTypes hint="raw:AddFieldTypes">
<!-- Text fields need to be tokenized -->
<fieldType name="single-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="multi-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="word document" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="html" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="rich text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="memo" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<!-- Multilist based fields need to be tokenized to support search of multiple values -->
<fieldType name="multilist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="treelist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="treelistex" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="checklist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<!-- Legacy tree list field from ver. 5.3 -->
<fieldType name="tree list" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
</fieldTypes>
</master>
</locations>
</index>
</indexes>
</configuration>
</search>
</sitecore>
</configuration>
When I am running my solution after this I am looking my indexes through 'Index Viewer' but couldn't see anything. What I am doing wrong here?
I added this code:
private IDictionary<string, Sitecore.Search.Index> GetSearchIndexes()
{
var _configuration = Sitecore.Configuration.Factory.CreateObject("search/configuration", true) as Sitecore.Search.SearchConfiguration;
return _configuration.Indexes;
}
But in the return of _configuration.Indexes I am getting: master, web, advanced. My index is different, these are the list of DBs.
I assume you mean web.config and not app.config.
Go to Sitecore > Control Panel > Database > Rebuild the Search Index to generate the index on the file system.
Or, download this script and run it.

How to add a specific content item using Advance Database Crawler?

I read this question: How can I get the Advanced Database Crawler to index the item name
But want to ask that it I want to index a content item folder which is under: /sitecore/content/Data/MyNewsFeed
and I want to create an index on it, I wrote this code in my .config file:
<configuration xmlns:x="http://www.sitecore.net/xmlconfig/">
<sitecore>
<databases>
<database id="master" singleInstance="true" type="Sitecore.Data.Database, Sitecore.Kernel">
<Engines.HistoryEngine.Storage>
<obj type="Sitecore.Data.$(database).$(database)HistoryStorage, Sitecore.Kernel">
<param connectionStringName="$(id)" />
<EntryLifeTime>30.00:00:00</EntryLifeTime>
</obj>
</Engines.HistoryEngine.Storage>
<Engines.HistoryEngine.SaveDotNetCallStack>false</Engines.HistoryEngine.SaveDotNetCallStack>
</database>
</databases>
<search>
<configuration>
<indexes>
<index id="web" type="Sitecore.Search.Index, Sitecore.Kernel">
<param desc="name">$(id)</param>
<param desc="folder">master</param>
<Analyzer ref="search/analyzer" />
<locations hint="list:AddCrawler">
<master type="Sitecore.SharedSource.SearchCrawler.Crawlers.AdvancedDatabaseCrawler,Sitecore.SharedSource.SearchCrawler">
<Database>master</Database>
<Root>/sitecore/content/Data/MyNewsFeed</Root>
<IndexAllFields>true</IndexAllFields>
<fieldCrawlers hint="raw:AddFieldCrawlers">
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.LookupFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Droplink" />
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Datetime" />
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Date" />
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.NumberFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Number" />
</fieldCrawlers>
<!-- If a field type is not defined, defaults of storageType="NO", indexType="UN_TOKENIZED" vectorType="NO" boost="1f" are applied-->
<fieldTypes hint="raw:AddFieldTypes">
<!-- Text fields need to be tokenized -->
<fieldType name="single-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="multi-line text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="word document" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="html" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="rich text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="memo" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="text" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<!-- Multilist based fields need to be tokenized to support search of multiple values -->
<fieldType name="multilist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="treelist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="treelistex" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<fieldType name="checklist" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
<!-- Legacy tree list field from ver. 5.3 -->
<fieldType name="tree list" storageType="NO" indexType="TOKENIZED" vectorType="NO" boost="1f" />
</fieldTypes>
</master>
</locations>
</index>
</indexes>
</configuration>
</search>
</sitecore>
</configuration>
SO basically I targeted the root to MyNewsFeed folder. Is there any other way I can achieve this? Thanks!
I added this snippet:
<locations hint="list:AddCrawler">
<master type="Sitecore.SharedSource.SearchCrawler.Crawlers.AdvancedDatabaseCrawler,Sitecore.SharedSource.SearchCrawler">
<Database>master</Database>
<Root>/sitecore/content/Data/myNewsFeed</Root>
<IndexAllFields>false</IndexAllFields>
<include hint="list:IncludeTemplate">
<template1>{GUID here}</template1>
<template2>{GUID here}</template2>
</include>
<fieldCrawlers hint="raw:AddFieldCrawlers">
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.LookupFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Droplink" />
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Datetime" />
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.DateFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Date" />
<fieldCrawler type="Sitecore.SharedSource.SearchCrawler.FieldCrawlers.NumberFieldCrawler,Sitecore.SharedSource.SearchCrawler" fieldType="Number" />
</fieldCrawlers>
You're config is correct, but you need to tell it what template types to include in the index, e.g.
<include hint="list:IncludeTemplate">
<template1>{GUID here}</template1>
<template2>{GUID here}</template2>
</include>

Resources