|
@@ -40,7 +40,6 @@ class SearchPage extends React.Component {
|
|
|
focusedSearchResultData: null,
|
|
focusedSearchResultData: null,
|
|
|
selectedPagesIdList: new Set(),
|
|
selectedPagesIdList: new Set(),
|
|
|
searchResultCount: 0,
|
|
searchResultCount: 0,
|
|
|
- shortBodiesMap: null,
|
|
|
|
|
activePage: 1,
|
|
activePage: 1,
|
|
|
pagingLimit: this.props.appContainer.config.pageLimitationL || 50,
|
|
pagingLimit: this.props.appContainer.config.pageLimitationL || 50,
|
|
|
excludeUserPages: true,
|
|
excludeUserPages: true,
|
|
@@ -152,11 +151,6 @@ class SearchPage extends React.Component {
|
|
|
this.setState({ pagingLimit: limit }, () => this.search({ keyword: this.state.searchedKeyword }));
|
|
this.setState({ pagingLimit: limit }, () => this.search({ keyword: this.state.searchedKeyword }));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- async fetchShortBodiesMap(pageIds) {
|
|
|
|
|
- const res = await apiv3Get('/page-listing/short-bodies', { pageIds });
|
|
|
|
|
- this.setState({ shortBodiesMap: res.data.shortBodiesMap });
|
|
|
|
|
- }
|
|
|
|
|
-
|
|
|
|
|
// todo: refactoring
|
|
// todo: refactoring
|
|
|
// refs: https://redmine.weseek.co.jp/issues/82139
|
|
// refs: https://redmine.weseek.co.jp/issues/82139
|
|
|
async search(data) {
|
|
async search(data) {
|
|
@@ -195,17 +189,18 @@ class SearchPage extends React.Component {
|
|
|
order,
|
|
order,
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // TODO: fetch with /page-listing/info
|
|
|
|
|
+ // https://redmine.weseek.co.jp/issues/87695
|
|
|
/*
|
|
/*
|
|
|
* non-await asynchronous short body fetch
|
|
* non-await asynchronous short body fetch
|
|
|
*/
|
|
*/
|
|
|
- const pageIds = res.data.map((page) => {
|
|
|
|
|
- if (page.pageMeta?.elasticSearchResult != null && page.pageMeta?.elasticSearchResult?.snippet.length !== 0) {
|
|
|
|
|
- return null;
|
|
|
|
|
- }
|
|
|
|
|
|
|
+ // const pageIds = res.data.map((page) => {
|
|
|
|
|
+ // if (page.pageMeta?.elasticSearchResult != null && page.pageMeta?.elasticSearchResult?.snippet.length !== 0) {
|
|
|
|
|
+ // return null;
|
|
|
|
|
+ // }
|
|
|
|
|
|
|
|
- return page.pageData._id;
|
|
|
|
|
- }).filter(id => id != null);
|
|
|
|
|
- this.fetchShortBodiesMap(pageIds);
|
|
|
|
|
|
|
+ // return page.pageData._id;
|
|
|
|
|
+ // }).filter(id => id != null);
|
|
|
|
|
|
|
|
this.changeURL(keyword);
|
|
this.changeURL(keyword);
|
|
|
if (res.data.length > 0) {
|
|
if (res.data.length > 0) {
|
|
@@ -324,7 +319,6 @@ class SearchPage extends React.Component {
|
|
|
focusedSearchResultData={this.state.focusedSearchResultData}
|
|
focusedSearchResultData={this.state.focusedSearchResultData}
|
|
|
selectedPagesIdList={this.state.selectedPagesIdList || []}
|
|
selectedPagesIdList={this.state.selectedPagesIdList || []}
|
|
|
searchResultCount={this.state.searchResultCount}
|
|
searchResultCount={this.state.searchResultCount}
|
|
|
- shortBodiesMap={this.state.shortBodiesMap}
|
|
|
|
|
activePage={this.state.activePage}
|
|
activePage={this.state.activePage}
|
|
|
pagingLimit={this.state.pagingLimit}
|
|
pagingLimit={this.state.pagingLimit}
|
|
|
onClickItem={this.selectPage}
|
|
onClickItem={this.selectPage}
|