The OneDealer Enterprise Search is a powerful feature of OneDealer for searching information. Behind the scenes we use Lucene search engine by creating catalogues that are being produced from data indexing in our databases.

The search is being made inside of the OneDealer, but the catalogue generation is executed by an external console application. This application can be executed by a task scheduler or manually. Another scenario of data indexing is by triggering the Lucene indexing through OneDealer.

OneDealer Lucene application

The heart of application is the LuceneConfig.xml file where we define

  • the database schema that we want to index
  • the business entities that we want to index
Example of LuceneConfig
<?xml version="1.0" encoding="utf-8" ?>
<OneDealerSetupLuceneIndexer>
  <!-- Root folder of the Lucene app -->
  <RootFolder>X:\XXXXXX\XXXX\XXXX</RootFolder>
  <!-- Execution folder of Lucene app -->
  <LuceneExecutionRootFolder>X:\XXXXXX\XXXX\XXXX\XXXXX</LuceneExecutionRootFolder>
  <InstallationIndexers>
    <LuceneInstallationIndexer>

	  <!-- List of schema names to be indexed -->
      <SchemaNames>
        <LuceneSchema>
          <SchemaName>RCGENDEV</SchemaName>
  		  <!-- If it has B1 Service Layer define the time difference -->
          <ServiceLayerTimeDifference>0</ServiceLayerTimeDifference>
        </LuceneSchema>
      </SchemaNames>

	  <!-- List of Business Entities to be indexed -->
      <LuceneBusinessEntities>

	    <!-- Business Entity to be indexed -->
        <LuceneBusinessEntity>
        </LuceneBusinessEntity>

      </LuceneBusinessEntities>

    </LuceneInstallationIndexer>
	<!-- Lucene Indexer Dimensions -->
      <Dimensions>
        <LuceneDimension>
          <Name>UserId</Name>
        </LuceneDimension>
        <LuceneDimension>
          <Name>SalesPersonCode</Name>
        </LuceneDimension>
        <LuceneDimension>
          <Name>U_IDMS_DIM_Company</Name>
        </LuceneDimension>
      </Dimensions>

  </InstallationIndexers>

</OneDealerSetupLuceneIndexer>

LuceneBusinessEntity

LuceneBusinessEntity  is a class name that contains valuable information regarding the data indexing and the data that are going to be displayed inside OneDealer. Let's see the definition of LuceneBusinessEntity  class:

PropertyDescriptionIs Required
EntityNameThe name of the Entity to be indexed
  •  
AssemblyIocProviderA fully assembly qualified name of a custom provider
EntityFriendlyNameThe name of the entity to be displayed in OneDealer
  •  
PropertyNameIdThe property name of the entity that represents the Primary key / id
  •  
EntityTitlePropertyThe property name of the entity that represents Title, Description or name
  •  
UrlEntityThe url that will be linked in the result
  •  
UrlEntityKeyThe entity key name to navigate through the link
UrlQueryStringNameKeyThe parameter name that is expected for the key name
  •  
MasterEntityif the Entity name is a view, we declare here the actual entity that represents
CreateDateFieldThe property name of the entity that contains the Creation date
CreateTimeFieldThe property name of the entity that contains the Creation time
UpdateDateFieldThe property name of the entity that contains the Update date
UpdateTimeFieldThe property name of the entity that contains the Update time
IsServiceLayerif the property is SL object
CssClassa css class name  for icon
DataProviderFiltersList of Filters
BusinessEntityFieldsList of properties to be displayed in OneDealer
  •  
EntityDimensionsList of the dimension properties of the entity

AssemblyIocProvider

Here we can declare a custom implementation of ILuceneBusinessEntityDataProvider  interface for indexing data.

An example is the data indexing of external sources, such as Incadea.

We created the OneDealerLuceneIncadeaExternalDataProvider  class, which inherits from OneDealerLuceneExternalDataProvider<T> that executes HTTP requests through the declared IInterfacingManager .

The IInterfacingManager implementation has a configuration of the base address URL and the URI that is going to be called.

DataProviderFilters

List of static filters to execute the query to the database

LuceneDataProviderFilterDescription
ValueTypeThe expected value typec# System Type (sting, int, etc)
Fieldthe property name to filter
Valuethe value to filter
FilterOperatorthe operator
FilterOperator
Equals
NotEqual
Contains
GreaterThan
GreaterThanOrEqual
LessThanOrEqual
LessThan
In
StartsWith

BusinessEntityFields

Type
DescriptionIs Required
StringField
The type of the field to be displayed
  •  

PropertyNameThe property name of the entity to be binded
  •  

FieldNameThe name of the field to be displayed
  •  
NumberField

  •  

PropertyNameThe property name of the entity to be binded
  •  

FieldNameThe name of the field to be displayed
  •  

NumberFormat

EntityDimensions

LuceneEntityDimensionDescription
DimensionNameThe dimension property name of the Lucene Indexer
PropertyNameThe property name of the entity for the dimension
  • No labels
Write a comment…