1 /* 2 * Copyright 2007-2012 the original author or authors. 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17 package org.springbyexample.httpclient.solr; 18 19 20 21 /** 22 * Optional attributes for a commit or optimize request. 23 * 24 * @author David Winterfeldt 25 */ 26 public class SolrRequestAttributes { 27 28 private Integer maxSegments = null; 29 private Boolean waitFlush = null; 30 private Boolean waitSearcher = null; 31 32 /** 33 * Gets max segments. 34 * Used to optimize down to at most this number of segments. 35 * Defaults to '1'. 36 */ 37 public Integer getMaxSegments() { 38 return maxSegments; 39 } 40 41 /** 42 * Sets max segments. 43 * Used to optimize down to at most this number of segments. 44 * Defaults to '1'. 45 */ 46 public void setMaxSegments(Integer maxSegments) { 47 this.maxSegments = maxSegments; 48 } 49 50 /** 51 * Gets whether or not to wait flush. 52 * Will block until index changes are flushed to disk. 53 * Defaults to <code>true</code>. 54 */ 55 public Boolean getWaitFlush() { 56 return waitFlush; 57 } 58 59 /** 60 * Sets whether or not to wait flush. 61 * Will block until index changes are flushed to disk. 62 * Defaults to <code>true</code>. 63 */ 64 public void setWaitFlush(Boolean waitFlush) { 65 this.waitFlush = waitFlush; 66 } 67 68 /** 69 * Gets whether or not to wait for the searcher. 70 * Will block until a new searcher is opened and registered as the main query searcher, making the changes visible. 71 * Defaults to <code>true</code>. 72 */ 73 public Boolean getWaitSearcher() { 74 return waitSearcher; 75 } 76 77 /** 78 * Sets whether or not to wait for the searcher. 79 * Will block until a new searcher is opened and registered as the main query searcher, making the changes visible. 80 * Defaults to <code>true</code>. 81 */ 82 public void setWaitSearcher(Boolean waitSearcher) { 83 this.waitSearcher = waitSearcher; 84 } 85 86 87 } 88