承接 sitegeist/taxonomy-elasticsearch 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

sitegeist/taxonomy-elasticsearch

Composer 安装命令:

composer require sitegeist/taxonomy-elasticsearch

包简介

README 文档

README

elastic search integration for Sitegeist.Taxonomy

This package configures the elastic search indexing of taxonomy nodes and provides an EEL helper for custom indexing configurations. It also provides an EEL helper for taxonomy-aware elastic search querying.

Status

This is currently experimental code so do not rely on any part of this.

Authors & Sponsors

The development and the public-releases of this package is generously sponsored by our employer http://www.sitegeist.de.

EEL-Helpers

TaxonomyIndexing

  • TaxonomyIndexing.extractIdentifierAndParentIdentifiers() Get an array of taxon identifiers including all parent taxons for the given taxon nodes

TaxonomySearch

Find taxonomies that match the fulltext query.

# Build searchQuery
searchQuery = ${Search.query( Taxonomy.root() ).fulltext( searchTerm ).nodeType('Sitegeist.Taxonomy:Taxonomy')}

# Number of serach results
totalSearchResults = ${this.searchQuery.count()}

# Execute query
searchResults = ${this.searchQuery.execute()}

Often you want to combine the search for taxons with the document serach. This examples will find results that match the term via fulltext or that are referencing a taxonomies that matched the fulltext.

# Array with IDs of taxonomies that match the term
@context.taxonomyIds = ${this.taxonomies}
@context.taxonomyIds.@process.convertToIds = Neos.Fusion:RawCollection {
    collection = ${Search.query( Taxonomy.root() ).fulltext( searchTerm ).nodeType('Sitegeist.Taxonomy:Taxonomy').execute().toArray()}
    itemName = 'taxon'
    itemRenderer = ${q(taxon).property('_identifier')}
}

# Find documents that either match fulltext or are assigned to a taxon that matched

# Build searchQuery
searchQuery = ${Search.query(site).nodeType('Neos.Neos:Document').limit(100)}

# Append setting to get results with a minimum match of 1
searchQuery.@process.setMinimumShouldMatch = ${value.request('query.filtered.query.bool.minimum_should_match', 1)}

# Append query with fulltext string search term
searchQuery.@process.setTermCondition = ${value.request('query.filtered.query.bool.should', [{'query_string': {'query': searchTerm}}])}

# Append query with search by taxonomy (if any)
searchQuery.@process.setTaxonomyCondition = ${value.appendAtPath('query.filtered.query.bool.should', {'terms': {'taxonomyReferences':taxonomyIds}})}
searchQuery.@process.setTaxonomyCondition.@if.has = ${taxonomyIds ? true : false}

# Number of serach results
totalSearchResults = ${this.searchQuery.count()}

# Execute query
searchResults = ${this.searchQuery.execute()}

Indexing of Taxonomies

The title and description field of taxonomies are added to the fulltext index.

Contribution

We will gladly accept contributions. Please send us pull requests.

License

See LICENSE

统计信息

  • 总下载量: 11.77k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 4
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 4
  • Watchers: 3
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-3.0
  • 更新时间: 2018-10-10