# I want to increase the speed of search

**URL:** https://discuss.elastic.co/t/i-want-to-increase-the-speed-of-search/11336
**Category:** Elasticsearch
**Created:** [March 27, 2013, 1:50pm UTC](https://discuss.elastic.co/t/i-want-to-increase-the-speed-of-search/11336 "2013-03-27T13:50:39Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![11115](https://avatars.discourse-cdn.com/v4/letter/1/eb9ed0/32.png) [@11115](https://discuss.elastic.co/u/11115)
#### Post date: [March 27, 2013, 1:50pm UTC](https://discuss.elastic.co/t/i-want-to-increase-the-speed-of-search/11336/1 "2013-03-27T13:50:39Z")

</div>

I do not speak English, please understand

_System Specifications_  
Number of nodes: 4  
CPU model: Quad-Core AMD Opteron(tm) Processor 2347 HE (1900 MHz)  
CPU total logical cores: 8  
Memory : 8G \* 4

_Elasticsearch Settings_  
index.number\_of\_shards: 8  
index.number\_of\_replicas: 1  
node.master: true  
node.data: true  
bootstrap.mlockall: true  
transport.tcp.compress: true  
network.tcp.keep\_alive: true  
cluster.routing.allocation.node\_initial\_primaries\_recoveries: 1  
cluster.routing.allocation.node\_concurrent\_recoveries: 1  
cluster.routing.allocation.cluster\_concurrent\_rebalance: 1  
index.shard.recovery.concurrent\_streams: 2  
cluster.routing.allocation.disable\_allocation: false  
cluster.routing.allocation.disable\_replica\_allocation: false  
discovery.zen.ping.timeout: 10s  
discovery.zen.ping.multicast.enabled: false  
index.cache.field.type: soft  
index.term\_index\_interval: 64  
index.refresh\_interval: 30

_Elasticsearch Start option_  
bin/elasticsearch -Xmx4G -Xms4G -Des.index.storage.type=memory

_Documents Info_  
_size: 49gb (98.2gb)  
docs: 18214105 (18214590)_

_Search Condition_

1. Were routing to each user ID.
2. Java Code  
FilterBuilder[] reporterFilters = null;  
FilterBuilder filters = null;

SearchRequestBuilder builder = client.prepareSearch(index);  
builder.setFrom((Integer) params.get("searchFrom"));  
builder.setSize((Integer) params.get("searchCnt"));  
builder.setTypes(type);  
builder.addSort((String) params.get("sortField"), (Boolean)  
params.get("ascending") ? SortOrder.ASC : SortOrder.DESC);

//Set date range filter  
if (params.get("fromDate") != null) {  
filters =  
FilterBuilders.rangeFilter("regDate").from(params.get("fromDate")).to(params.get("toDate"));  
}

//Set category filter  
if (params.get("categoryId") != null) {  
filters =  
FilterBuilders.andFilter(FilterBuilders.termFilter("categoryId",  
params.get("categoryId")), filters);  
}

//Set query filter  
if (params.get("query") != null) {  
builder.setQuery(QueryBuilders  
.queryString((String) params.get("query"))  
.field("title")  
.field("summary")  
.field("content")  
.defaultOperator(QueryStringQueryBuilder.Operator.AND)  
.analyzer("cjk")  
.useDisMax(true)  
);  
}

builder.setFilter(filters);

SearchResponse response = builder  
.execute()  
.actionGet();

\*Current caching before, it takes about 2-4 seconds.

I would like to receive a response within one second.  
What can I do?  
\*  
_Thanks in advance for your answer._

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![11115](https://avatars.discourse-cdn.com/v4/letter/1/eb9ed0/32.png) [@11115](https://discuss.elastic.co/u/11115)
#### Post date: [March 27, 2013, 1:54pm UTC](https://discuss.elastic.co/t/i-want-to-increase-the-speed-of-search/11336/2 "2013-03-27T13:54:14Z")

</div>

My Elasticsearch version is 0.20.6

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
For more options, visit [https://groups.google.com/groups/opt\_out](https://groups.google.com/groups/opt_out).

---

<div class="post-metadata">

### Author: ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)
#### Post date: [July 6, 2017, 2:44am UTC](https://discuss.elastic.co/t/i-want-to-increase-the-speed-of-search/11336/3 "2017-07-06T02:44:11Z")

</div>


