appbaseio / appbaseio/reactivesearch

Set MultiList defaultQuery based on Select Option

オープン
#1,407 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
enhancement
主要言語
JavaScript
スター
4.9k
フォーク
478
PR マージ指標
30日以内にマージされた PR はありません

説明

**Affected Projects**
React / ReactNative

**Is your feature request related to a problem? Please describe.**
I am trying to build a Reactivesearch based Searchwebsite with a MultiList Selection. The terms within that MultiList selection should come from a significant terms aggregation
( https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html)

The only way i could think of after carefully going through your docs (I am new to react so sorry for not knowing basics) was to use a defaultQuery for the MultiList component. So currently my MultiList looks like this:
```

```

The corresponding Javascript function to generate the defaultQuery looks like this:
```
function generateDefaultQuery(typ,feld) {
if (typ==="percentage") { var aggs=() => ( { aggs: { "meshqual": { significant_terms: { field: feld, percentage: {}, size: 10 }},},} ); }
else if (typ==="gnd") { var aggs=() => ( { aggs: { "meshqual": { significant_terms: { field: feld, gnd: {}, size: 10 }},},} ); }
console.log(aggs);
console.log(typ);
return aggs
}
```
The thing is, Elasticsearch offers a variety of siginificant_terms aggregation methods (https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html#_parameters) e.g. JLH, Chi square or GND. What i would like to have is a dropdown menu where the user can select the preferred method and based on that selection the query of the MultiList component needs to be updated immediately. I tried it with simple Select elements but i do not know how to pass those to MultiList and to make MultiList immediately pick them up to render the new terms based on the selected method (e.g. GND)?

```

JLH
Mutual Information
Chi square
Google normalized disctance
Percentage

```

Any help is highly appreciated

**Describe the solution you'd like**
Maybe it would be a great feature of MultiList in the future if the props would provide something like to choose from:
```
QueryType: terms or significant_terms
Significant_term_type: [ „JLH“, „Mutual Information“, „GND“,“Chi square“, „percentage“]
```

**Describe alternatives you've considered**
Look above, i tried it with a Select Element but i am new to react and do not exactly now how to pass the selection to MultiList.

**Additional context**
DropDown Menu to select the significant terms Type (JLH, GND, etc.)

DropDown-Select

MultiList displaying the significant_terms based on the selected method from Dropdown:

MultiList

コントリビューションガイド

コントリビューションガイドを開く

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。