Rechercher

Ce contenu n'est pas disponible dans la langue sélectionnée.

12.12. Apache SOLR Translator

download PDF
The Apache SOLR Translator, known by the type name solr, exposes querying functionality to Solr Data Sources. Apache Solr is a search engine built on top of Apache Lucene for indexing and searching. This translator provides an easy way to connect to existing or new Solr search systems, and provides way to add documents/records directly from user or other sources that are integrated with JDV. It also gives ability to read/update/delete existing documents from Solr Search system.
The Solr Translator currently has no import or execution properties. It does not define any extension metadata.
Here are some usecases for this translator:
  • Solr source can be used in Teiid, to continually add/update the documents in the search system from other sources automatically.
  • If the search fields are stored in Solr system, this can be used as very low latency data retrieval for serving high traffic applications.
  • The Solr translator can be used as a fast full-text search system. The Solr document might only contain index information. If so, then the results will be an inverted index. You can use this to gather target documents from the other enterprise sources such as RDBMS, Web Services, SalesForce and so on, and consolidate them all in a single client call without any coding.
Solr search system provides searches based on indexed search fields. Each Solr instance is typically configured with a single core that defines multiple fields with different type information. Teiid metadata querying mechanism is equipped with "Luke" based queries, that at deploy time of the VDB use this mechanism to retrieve all the stored/indexed fields. Currently Teiid does NOT support dynamic fields and non-stored fields. Based on retrieved fields, Solr translator exposes a single table that contains all the fields. If a field is multi-value based, its type is represented as Array type.
Once this table is exposed through VDB in a Teiid database, and Solr Data Sources is created, the user can issue "INSERT/UPDATE/DELETE" based SQL calls to insert/update/delete documents into the Solr, and issue "SELECT" based calls to retrieve documents from Solr. You can use full range of SQL with Teiid system integrating other sources along with Solr source.
The Solr Translator supports SELECT statements with a restrictive set of capabilities including: comparison predicates, IN predicates, LIMIT and Order By.
Here is an example dynamic VDB:
<vdb name="search" version="1">
    <model name="solr">
        <source name="node-one" translator-name="solr" connection-jndi-name="java:/solrDS"/>
    </model>
<vdb>
The translator does NOT provide a connection to the Solr. For that purpose, Teiid has a JCA adapter that provides a connection to Solr using the SolrJ Java library. See an example in see an example in jboss-as/docs/teiid/datasources/solr
If you are using Designer Tooling, to create VDB then create/use a Teiid Designer Model project, use the "Teiid Connection - Source Model" importer, create a Solr Data Source using the Data Source Creation Wizard and use solr as translator in the importer. The search table is created in a source model by the time you finish with this importer. Create a VDB and deploy into Teiid Server and use either jdbc, odbc or odata to query.
Use the JDV-specific Solr Resource Adapter with this translator.
Red Hat logoGithubRedditYoutubeTwitter

Apprendre

Essayez, achetez et vendez

Communautés

À propos de la documentation Red Hat

Nous aidons les utilisateurs de Red Hat à innover et à atteindre leurs objectifs grâce à nos produits et services avec un contenu auquel ils peuvent faire confiance.

Rendre l’open source plus inclusif

Red Hat s'engage à remplacer le langage problématique dans notre code, notre documentation et nos propriétés Web. Pour plus de détails, consultez leBlog Red Hat.

À propos de Red Hat

Nous proposons des solutions renforcées qui facilitent le travail des entreprises sur plusieurs plates-formes et environnements, du centre de données central à la périphérie du réseau.

© 2024 Red Hat, Inc.