当我搜索术语“postg”或“mysq”时,为什么search.maven.org不会返回结果?

时间:2015-10-08 21:13:09

标签: rest maven

我想知道为什么当我搜索“postg”或“mysq”这个词时search.maven.org网站没有返回任何结果。

示例:http://search.maven.org/solrsearch/select?q=postg&rows=20&wt=json

NetBeans“添加依赖项...”对话框在搜索这些术语时效果很好。 (我很确定它正在使用另一个REST API)

是否有一个很好的理由说明search.maven.org不会返回结果而只返回单词建议?

1 个答案:

答案 0 :(得分:0)

search.maven.org根据您提供的查询参数执行搜索。由于没有工件的groupId或artifactId为postg,因此结果为空。

但您可以使用通配符*来实现您想要的目标:

http://search.maven.org/solrsearch/select?q=postg*&rows=20&wt=json

此搜索网址将返回其groupId或artifactId以postg开头的所有工件。

如果您只想搜索以postg开头的artifactId,您可以使用以下网址:

http://search.maven.org/solrsearch/select?q=a:postg*&core=gav&rows=20&wt=json

或以postg开头的groupId和artifactId:

http://search.maven.org/solrsearch/select?q=g:postg*+AND+a:postg*&core=gav&rows=20&wt=json

Rest API记录在this page