Skip to content
This repository was archived by the owner on Oct 6, 2023. It is now read-only.

Commit 3f14671

Browse files
committed
adding "software_type" as a search/filter parameter for searching
Signed-off-by: Neal Ensor <[email protected]>
1 parent 9343bfe commit 3f14671

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/main/java/gov/osti/search/SearchData.java

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ public class SearchData implements Serializable {
4747
private String sort = null;
4848
private Integer rows;
4949
private Integer start;
50+
private String[] softwareType = null;
5051

5152
/**
5253
* Parses JSON in the request body of the reader into a SearchDaa object.
@@ -203,6 +204,18 @@ public String toQ() {
203204
q.append("(").append(codes.toString()).append(")");
204205
}
205206
}
207+
// support ARRAY of SOFTWARE TYPES
208+
if (null!=getSoftwareType()) {
209+
StringBuilder types = new StringBuilder();
210+
for ( String type : getSoftwareType() ) {
211+
if (types.length()>0) types.append(" OR ");
212+
types.append("softwareType:").append(type);
213+
}
214+
if ( types.length()>0) {
215+
if (q.length()>0) q.append(" ");
216+
q.append("(").append(types.toString()).append(")");
217+
}
218+
}
206219
if (null!=getLicenses()) {
207220
StringBuilder values = new StringBuilder();
208221
for ( String license : getLicenses() ) {
@@ -330,4 +343,18 @@ public void setLicenses(String[] licenses) {
330343
this.licenses = licenses;
331344
}
332345

346+
/**
347+
* @return the softwareType
348+
*/
349+
public String[] getSoftwareType() {
350+
return softwareType;
351+
}
352+
353+
/**
354+
* @param softwareType the softwareType to set
355+
*/
356+
public void setSoftwareType(String[] softwareType) {
357+
this.softwareType = softwareType;
358+
}
359+
333360
}

0 commit comments

Comments
 (0)