Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
S
shop
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
曲欣亮
shop
Commits
b0744e26
Commit
b0744e26
authored
Oct 13, 2018
by
Quxl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
搜索引擎接口
parent
1e29492f
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
392 additions
and
0 deletions
+392
-0
pom.xml
pom.xml
+5
-0
SolrGoodsController.java
...n/java/com/egolm/shop/controller/SolrGoodsController.java
+46
-0
SolrGoodsService.java
src/main/java/com/egolm/shop/service/SolrGoodsService.java
+18
-0
SolrGoodsServiceImpl.java
...ava/com/egolm/shop/service/impl/SolrGoodsServiceImpl.java
+323
-0
No files found.
pom.xml
View file @
b0744e26
...
...
@@ -73,6 +73,11 @@
<groupId>
org.springframework.boot
</groupId>
<artifactId>
spring-boot-starter-data-redis
</artifactId>
</dependency>
<dependency>
<groupId>
org.apache.solr
</groupId>
<artifactId>
solr-solrj
</artifactId>
<version>
6.0.1
</version>
</dependency>
</dependencies>
<build>
<plugins>
...
...
src/main/java/com/egolm/shop/controller/SolrGoodsController.java
0 → 100644
View file @
b0744e26
package
com
.
egolm
.
shop
.
controller
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Controller
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.ResponseBody
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
import
com.egolm.shop.service.SolrGoodsService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
@Api
@Controller
@RequestMapping
(
"solr/goods"
)
public
class
SolrGoodsController
{
@Autowired
private
SolrGoodsService
service
;
@ResponseBody
@RequestMapping
(
"query"
)
@ApiOperation
(
"搜索引擎商品搜索"
)
public
Object
query
(
Page
page
,
String
queryKey
,
String
[]
keywords
,
String
[]
orders
,
String
[]
facetFields
,
String
[]
facetPivotFields
)
{
return
service
.
query
(
page
,
queryKey
,
keywords
,
orders
,
facetFields
,
facetPivotFields
);
}
@ResponseBody
@RequestMapping
(
"update"
)
@ApiOperation
(
"搜索引擎更新全部商品索引"
)
public
Object
update
()
{
service
.
update
();
return
Rjx
.
jsonOk
();
}
@ResponseBody
@RequestMapping
(
"updateByDistrictID"
)
@ApiOperation
(
"搜索引擎按区域编号更新商品索引"
)
public
Object
updateByDistrictID
(
String
sDistrictID
)
{
service
.
update
(
sDistrictID
);
return
Rjx
.
jsonOk
();
}
}
src/main/java/com/egolm/shop/service/SolrGoodsService.java
0 → 100644
View file @
b0744e26
package
com
.
egolm
.
shop
.
service
;
import
com.egolm.common.bean.Rjx
;
import
com.egolm.common.jdbc.Page
;
public
interface
SolrGoodsService
{
public
Rjx
query
(
Page
page
,
String
queryKey
,
String
[]
keywords
,
String
[]
orders
,
String
[]
facetFields
,
String
[]
facetPivotFields
);
public
void
update
();
public
void
update
(
String
sDistrictID
);
public
void
deleteByQuery
(
String
queryKey
);
public
void
deleteById
(
String
[]
documentIds
);
}
src/main/java/com/egolm/shop/service/impl/SolrGoodsServiceImpl.java
0 → 100644
View file @
b0744e26
This diff is collapsed.
Click to expand it.
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment