This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Document(indexName = "entity") | |
@Setting(settingPath = "/config/elasticsearch/setting/autocomplete.json") | |
public class Entity implements Serializable { | |
@Column(name = "name") | |
@MultiField( | |
mainField = @Field(type = FieldType.String), | |
otherFields = { | |
@NestedField( |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="searchForm" class="form-inline"> | |
<div class="form-group"> | |
<div class="input-group"> | |
<input type="text" class="form-control" ng-model="searchQuery" id="searchQuery" placeholder="query"> | |
<span class="input-group-btn"> | |
<button class="btn btn-info" ng-click="search(searchQuery)"> | |
<span class="glyphicon glyphicon-search"></span> | |
</button> | |
</span> | |
<span class="input-group-btn"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form name="searchForm" class="form-inline"> | |
<div class="form-group"> | |
<div class="input-group"> | |
<input type="text" class="form-control" ng-model="searchQuery" id="searchQuery" placeholder="query"> | |
<span class="input-group-btn"> | |
<button class="btn btn-info" ng-click="search(searchQuery)"> | |
<span class="glyphicon glyphicon-search"></span> | |
</button> | |
</span> | |
<span class="input-group-btn"> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.loadOtherEntities = function(searchQuery) { | |
if (searchQuery){ | |
OtherEntitySearch.query({query: '*' + searchQuery + '*'}, function(result) { | |
$scope.otherEntities = result; | |
}, function(response) { | |
if(response.status === 404) { | |
$scope.otherEntities = OtherEntity.query({isActive: true}); | |
} | |
}); | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package [package].web.rest; | |
import com.codahale.metrics.annotation.Timed; | |
import [package].security.AuthoritiesConstants; | |
import [package].security.SecurityUtils; | |
import [package].service.ElasticsearchIndexService; | |
import org.slf4j.Logger; | |
import org.slf4j.LoggerFactory; | |
import org.springframework.http.HttpStatus; | |
import org.springframework.http.MediaType; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@And({@Spec(path = "field1", spec = In.class), | |
@Spec(path = "field2", spec = In.class), | |
@Spec(path = "fetch", spec = FetchSpecification.class, constVal = {"lazyRelationship1", "lazyRelationship2"})}) | |
Specification<Entity> entitySpec, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* SEARCH /_search/entities/:query -> search for the entity corresponding | |
* to the query. | |
*/ | |
@RequestMapping(value = "/_search/entities/{query}", | |
method = RequestMethod.GET, | |
produces = MediaType.APPLICATION_JSON_VALUE) | |
@Timed | |
public ResponseEntity<List<Entity>> searchEntities(@PathVariable String query, Pageable pageable) throws URISyntaxException { | |
Page<Entity> page = truckSearchRepository.search(queryStringQuery(query), pageable); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<tr jh-sort="predicate" ascending="reverse" callback="loadAll"> | |
<th jh-sort-by="id" translate="global.field.id">ID</th> | |
<th jh-sort-by="testField" translate="jhipsterApp.test123.testField">TestField</th> | |
<th jh-sort-by="point.id" translate="jhipsterApp.test123.point">point</th> | |
<th jh-sort-by="address.id" translate="jhipsterApp.test123.address">address</th> | |
<th></th> | |
</tr> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$scope.predicate = 'id'; | |
$scope.reverse = true; | |
$scope.loadAll = function() { | |
Client.query({page: $scope.page, size: 20, sort: $scope.predicate + ',' + ($scope.reverse ? 'asc' : 'desc')}, function(result, headers) { | |
$scope.links = ParseLinks.parse(headers('link')); | |
$scope.clients = result; | |
}); | |
}; |