Revision 7716
Added by Jing Tao over 11 years ago
metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/EmbeddedSolrQueryService.java | ||
---|---|---|
41 | 41 |
import org.apache.solr.core.CoreContainer; |
42 | 42 |
import org.apache.solr.core.SolrCore; |
43 | 43 |
import org.apache.solr.schema.SchemaField; |
44 |
import org.dataone.cn.indexer.solrhttp.SolrDoc; |
|
45 | 44 |
import org.dataone.service.exceptions.NotFound; |
46 | 45 |
import org.dataone.service.exceptions.NotImplemented; |
47 | 46 |
import org.dataone.service.exceptions.UnsupportedType; |
... | ... | |
129 | 128 |
} |
130 | 129 |
|
131 | 130 |
|
132 |
/** |
|
133 |
* Get the list of SolrDocs for the specified ids from the solr server. |
|
134 |
* * Note: each id only can have one SolrDoc or null SolrDoc. If it is null, it |
|
135 |
* wouldn't be added to the list. |
|
136 |
* @param ids the specified ids |
|
137 |
* @return the SolrDocs of the ids. |
|
138 |
* @throws Exception |
|
139 |
*/ |
|
140 |
public List<SolrDoc> query(List<String> ids) throws Exception { |
|
141 |
return null; |
|
142 |
} |
|
143 | 131 |
|
144 | 132 |
|
145 | 133 |
/** |
metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/HttpSolrQueryService.java | ||
---|---|---|
37 | 37 |
import org.apache.commons.logging.Log; |
38 | 38 |
import org.apache.commons.logging.LogFactory; |
39 | 39 |
import org.apache.solr.client.solrj.impl.CommonsHttpSolrServer; |
40 |
import org.apache.solr.client.solrj.util.ClientUtils; |
|
40 | 41 |
|
41 | 42 |
import org.apache.solr.common.params.SolrParams; |
42 | 43 |
import org.apache.solr.schema.SchemaField; |
43 |
import org.dataone.cn.indexer.solrhttp.HTTPService; |
|
44 |
import org.dataone.cn.indexer.solrhttp.SolrDoc; |
|
45 | 44 |
import org.dataone.service.exceptions.NotFound; |
46 | 45 |
import org.dataone.service.exceptions.NotImplemented; |
47 | 46 |
import org.dataone.service.types.v1.Subject; |
... | ... | |
85 | 84 |
StringBuffer accessFilter = generateAccessFilterParamsString(subjects); |
86 | 85 |
if(accessFilter != null && accessFilter.length() != 0) { |
87 | 86 |
query = solrServerBaseURL+"/select?"+query+"&"+FILTERQUERY+"="+accessFilter.toString(); |
88 |
query = HTTPService.escapeQueryChars(query);
|
|
87 |
query = ClientUtils.escapeQueryChars(query);
|
|
89 | 88 |
} else { |
90 | 89 |
throw new NotFound("0000", "HttpSolrQueryService.query - There is no identity (even user public) for the user who issued the query"); |
91 | 90 |
} |
... | ... | |
108 | 107 |
} |
109 | 108 |
|
110 | 109 |
|
111 |
/** |
|
112 |
* Get the list of SolrDocs for the specified ids from the solr server. |
|
113 |
* * Note: each id only can have one SolrDoc or null SolrDoc. If it is null, it |
|
114 |
* wouldn't be added to the list. |
|
115 |
* @param ids the specified ids |
|
116 |
* @return the SolrDocs of the ids. |
|
117 |
* @throws Exception |
|
118 |
*/ |
|
119 |
public List<SolrDoc> query(List<String> ids) throws Exception { |
|
120 |
return null; |
|
121 |
} |
|
122 | 110 |
|
123 | 111 |
|
124 | 112 |
/** |
... | ... | |
137 | 125 |
public String getSolrServerVersion() { |
138 | 126 |
return null; |
139 | 127 |
} |
128 |
|
|
129 |
|
|
140 | 130 |
} |
metacat-common/src/main/java/edu/ucsb/nceas/metacat/common/query/SolrQueryService.java | ||
---|---|---|
38 | 38 |
import org.apache.solr.common.params.SolrParams; |
39 | 39 |
import org.apache.solr.common.util.NamedList; |
40 | 40 |
import org.apache.solr.schema.SchemaField; |
41 |
import org.dataone.cn.indexer.solrhttp.SolrDoc; |
|
42 | 41 |
import org.dataone.service.types.v1.Subject; |
43 | 42 |
import org.dataone.service.util.Constants; |
44 | 43 |
|
... | ... | |
96 | 95 |
public abstract InputStream query(SolrParams query, Set<Subject>subjects) throws Exception; |
97 | 96 |
|
98 | 97 |
|
99 |
/** |
|
100 |
* Get the list of SolrDocs for the specified ids from the solr server. |
|
101 |
* * Note: each id only can have one SolrDoc or null SolrDoc. If it is null, it |
|
102 |
* wouldn't be added to the list. |
|
103 |
* @param ids the specified ids |
|
104 |
* @return the SolrDocs of the ids. |
|
105 |
* @throws Exception |
|
106 |
*/ |
|
107 |
public abstract List<SolrDoc> query(List<String> ids) throws Exception; |
|
98 |
|
|
108 | 99 |
|
109 |
|
|
110 | 100 |
/** |
111 | 101 |
* Get the fields list of the index schema |
112 | 102 |
* @return |
metacat-common/pom.xml | ||
---|---|---|
25 | 25 |
<version>3.4.0</version> |
26 | 26 |
</dependency> |
27 | 27 |
<dependency> |
28 |
<groupId>org.dataone</groupId> |
|
29 |
<artifactId>d1_cn_index_processor</artifactId> |
|
30 |
<version>1.2.0-SNAPSHOT</version> |
|
31 |
<type>jar</type> |
|
32 |
<exclusions> |
|
33 |
<exclusion> |
|
34 |
<groupId>org.slf4j</groupId> |
|
35 |
<artifactId>slf4j-log4j12</artifactId> |
|
36 |
</exclusion> |
|
37 |
</exclusions> |
|
38 |
</dependency> |
|
28 |
<groupId>org.dataone</groupId> |
|
29 |
<artifactId>d1_common_java</artifactId> |
|
30 |
<version>1.2.0-SNAPSHOT</version> |
|
31 |
<type>jar</type> |
|
32 |
<!-- exclude extraneous artifacts (jars) --> |
|
33 |
<exclusions> |
|
34 |
<exclusion> |
|
35 |
<groupId>org.jibx</groupId> |
|
36 |
<artifactId>jibx-tools</artifactId> |
|
37 |
</exclusion> |
|
38 |
<exclusion> |
|
39 |
<groupId>org.jibx</groupId> |
|
40 |
<artifactId>jibx-schema</artifactId> |
|
41 |
</exclusion> |
|
42 |
<exclusion> |
|
43 |
<groupId>org.jibx</groupId> |
|
44 |
<artifactId>jibx-extras</artifactId> |
|
45 |
</exclusion> |
|
46 |
<exclusion> |
|
47 |
<groupId>org.jibx</groupId> |
|
48 |
<artifactId>jibx-bind</artifactId> |
|
49 |
</exclusion> |
|
50 |
<exclusion> |
|
51 |
<groupId>org.apache.maven.plugins</groupId> |
|
52 |
<artifactId>maven-compiler-plugin</artifactId> |
|
53 |
</exclusion> |
|
54 |
<exclusion> |
|
55 |
<groupId>org.apache.maven.plugins</groupId> |
|
56 |
<artifactId>maven-jar-plugin</artifactId> |
|
57 |
</exclusion> |
|
58 |
<exclusion> |
|
59 |
<groupId>org.apache.maven.plugins</groupId> |
|
60 |
<artifactId>maven-clean-plugin</artifactId> |
|
61 |
</exclusion> |
|
62 |
<exclusion> |
|
63 |
<groupId>org.jibx</groupId> |
|
64 |
<artifactId>maven-jibx-plugin</artifactId> |
|
65 |
</exclusion> |
|
66 |
</exclusions> |
|
67 |
</dependency> |
|
39 | 68 |
</dependencies> |
40 | 69 |
</project> |
Also available in: Unified diff
Remove the depency on the d1_cn_index_processor.