Changeset 6874
- Timestamp:
- 21/05/10 08:26:06 (11 years ago)
- Location:
- TI01-discovery-API/trunk/MEDINDiscoveryService
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
TI01-discovery-API/trunk/MEDINDiscoveryService/pom.xml
r6838 r6874 4 4 <groupId>ndg.services.discovery</groupId> 5 5 <artifactId>MedinDiscoveryService</artifactId> 6 <version>1.1.1 0</version>6 <version>1.1.11</version> 7 7 <packaging>aar</packaging> 8 8 … … 14 14 15 15 <dependencies> 16 17 <dependency>18 <groupId>commons-dbcp</groupId>19 <artifactId>commons-dbcp</artifactId>20 <version>1.2.2</version>21 </dependency>22 23 <!--24 <dependency> <groupId>postgresql</groupId>25 <artifactId>postgresql</artifactId> <version>8.3-603.jdbc4</version>26 </dependency>27 -->28 16 29 17 <dependency> … … 205 193 <distributionManagement> 206 194 <snapshotRepository> 207 <id> local.deploy</id>195 <id>juliet.badc.rl.ac.uk.local</id> 208 196 <name>local-releases</name> 209 197 <url>http://juliet.badc.rl.ac.uk:8180/artifactory/libs-releases-local</url> 210 198 </snapshotRepository> 211 199 <repository> 212 <id> local.deploy</id>200 <id>juliet.badc.rl.ac.uk.local</id> 213 201 <name>local-releases</name> 214 202 <url>http://juliet.badc.rl.ac.uk:8180/artifactory/libs-releases-local</url> -
TI01-discovery-API/trunk/MEDINDiscoveryService/src/main/java/ndg/services/discovery/medin/DiscoveryDictionary.java
r6838 r6874 48 48 49 49 public static enum TermTarget { 50 FullText("document_ts_vector", "FullText"), 51 Author("authors_ts_vector", "Author"), 52 Parameters("parameters_ts_vector", "Parameters"), 53 ResourceType("resource_type_ts_vector", "ResourceType"), 54 TopicCategory("topic_category_ts_vector", "TopicCategory"), 55 Lineage("lineage_ts_vector", "Lineage"), 56 PublicAccessLimits("limitations_public_access_ts_vector", "PublicAccessLimits"), 57 DataOriginator("data_originator_tsvector", "DataOriginator"), 58 DataFormat("original_format_name", "DataFormat"); 59 60 private final String fieldName; 61 private final String fieldLabel; 62 TermTarget(String fieldName, String fieldLabel) { 63 this.fieldName = fieldName; 64 this.fieldLabel = fieldLabel; 65 } 66 public final String fieldName() { 67 return fieldName; 68 } 69 public final String fieldLabel() { 70 return fieldLabel; 50 FullText("document_ts_vector", "FullText", true), 51 Author("authors_ts_vector", "Author", true), 52 Parameters("parameters_ts_vector", "Parameters", true), 53 ResourceType("resource_type_ts_vector", "ResourceType", true), 54 TopicCategory("topic_category_ts_vector", "TopicCategory", true), 55 Lineage("lineage_ts_vector", "Lineage", true), 56 PublicAccessLimits("limitations_public_access_ts_vector", "PublicAccessLimits", true), 57 DataOriginator("data_originator_tsvector", "DataOriginator", true), 58 DataFormat("original_format_name", "DataFormat", false); 59 60 private final String fieldName; 61 private final String fieldLabel; 62 private final boolean vector; 63 TermTarget(String fieldName, String fieldLabel, boolean vector) { 64 this.fieldName = fieldName; 65 this.fieldLabel = fieldLabel; 66 this.vector = vector; 67 } 68 public final String fieldName() { 69 return fieldName; 70 } 71 public final String fieldLabel() { 72 return fieldLabel; 73 } 74 public final boolean isVector() { 75 return vector; 71 76 } 72 77 } -
TI01-discovery-API/trunk/MEDINDiscoveryService/src/main/java/ndg/services/discovery/model/PresentAgent.java
r6799 r6874 215 215 } 216 216 List<OriginalDocument> searchResult = executeSearch(conn, sqlQuery); 217 DiscoveryDictionary.RecordDetail detail = DiscoveryDictionary.getRecordDetails(type.getRecordDetail()); 217 218 DiscoveryDictionary.RecordDetail detail = DiscoveryDictionary.getRecordDetails(type == null ? null : type.getRecordDetail()); 218 219 if (detail.equals(DiscoveryDictionary.RecordDetail.DocumentFull) || detail.equals(DiscoveryDictionary.RecordDetail.DocumentSummary)) { 219 220 fillSpatialTemporalData(conn, searchResult); -
TI01-discovery-API/trunk/MEDINDiscoveryService/src/main/java/ndg/services/discovery/model/SearchAgent.java
r6767 r6874 298 298 } 299 299 300 whereSQL.append(" query" + Integer.toString(queryIndex) + " @@ ("); 301 whereSQL.append(termTarget.fieldName()); 302 whereSQL.append(") "); 300 whereSQL.append(" query" + Integer.toString(queryIndex) + " @@ "); 301 whereSQL.append(composeVector(termTarget)); 303 302 304 303 secondPass = true; … … 307 306 } 308 307 308 private String composeVector(DiscoveryDictionary.TermTarget termTarget){ 309 StringBuffer bf = new StringBuffer(); 310 bf.append(termTarget.isVector() ? "" : "to_tsvector"); 311 bf.append("("); 312 bf.append(termTarget.fieldName()); 313 bf.append(")"); 314 return bf.toString(); 315 } 316 309 317 private void preapareTemporalSearch(StringBuffer fromSQL, StringBuffer whereSQL, TemporalType temporalType) { 310 318 if (temporalType == null || temporalType.getDateRange() == null
Note: See TracChangeset
for help on using the changeset viewer.