Package org.apache.solr.common.params

Examples of org.apache.solr.common.params.DefaultSolrParams


  public Fragmenter getFragmenter(String fieldName, SolrParams params )
  {
    numRequests++;       
    if( defaults != null ) {
      params = new DefaultSolrParams( params, defaults );
    }
    int fragsize  = params.getFieldInt(   fieldName, HighlightParams.FRAGSIZE,  LuceneRegexFragmenter.DEFAULT_FRAGMENT_SIZE );
    int increment = params.getFieldInt(   fieldName, HighlightParams.INCREMENT, LuceneRegexFragmenter.DEFAULT_INCREMENT_GAP );
    float slop    = params.getFieldFloat( fieldName, HighlightParams.SLOP,      LuceneRegexFragmenter.DEFAULT_SLOP );
    int maxchars  = params.getFieldInt(   fieldName, HighlightParams.MAX_RE_CHARS, LuceneRegexFragmenter.DEFAULT_MAX_ANALYZED_CHARS );
View Full Code Here


{
  public Formatter getFormatter(String fieldName, SolrParams params )
  {
    numRequests++;
    if( defaults != null ) {
      params = new DefaultSolrParams( params, defaults );
    }
   
    return new SimpleHTMLFormatter(
        params.getFieldParam(fieldName, HighlightParams.SIMPLE_PRE,  "<em>" ),
        params.getFieldParam(fieldName, HighlightParams.SIMPLE_POST, "</em>"));
View Full Code Here

 
  private static SolrHighlighterX HIGHLIGHTER = new SolrHighlighterX();
 
   /** Combine request parameters with highlighting defaults. */
   static SolrParams getParams(SolrQueryRequest request) {
      return new DefaultSolrParams(request.getParams(), DEFAULTS);
   }
View Full Code Here

    assertEquals(p.getInt("i").intValue(), 555);
    assertEquals(p.getInt("i",5), 555);
    assertEquals(p.getInt("iii",5), 5);
    assertEquals(p.getFieldParam("field1","i"), "555");

    req.setParams(new DefaultSolrParams(p, new MapSolrParams(m)));
    p = req.getParams();
    assertEquals(req.getOriginalParams().get("s"), "bbb");
    assertEquals(p.get("i"), "555");
    assertEquals(p.getInt("i").intValue(), 555);
    assertEquals(p.getInt("i",5), 555);
View Full Code Here

    // these are not defined in params
    dmap.put( "dstr"               , "default"   );
    dmap.put( "dint"               , "123"       );
    // these are defined in params
    dmap.put( "int"                , "456"       );
    SolrParams defaults = new DefaultSolrParams( params, new MapSolrParams( dmap ) );
 
    // in params, not in default
    assertEquals( pstr                  , defaults.get( "str"      ) );
    // in default, not in params
    assertEquals( "default"             , defaults.get( "dstr"      ) );
    assertEquals( new Integer(123)      , defaults.getInt"dint"     ) );
    // in params, overriding defaults
    assertEquals( pint                  , defaults.getInt(   "int"      ) );
    // in neither params nor defaults
    assertNull( defaults.get( "asagdsaga" ) );
  }
View Full Code Here

{
  public Fragmenter getFragmenter(String fieldName, SolrParams params )
  {
    numRequests++;
    if( defaults != null ) {
      params = new DefaultSolrParams( params, defaults );
    }
   
    int fragsize = params.getFieldInt( fieldName, HighlightParams.FRAGSIZE, 100 );
    return (fragsize <= 0) ? new NullFragmenter() : new LuceneGapFragmenter(fragsize);
  }
View Full Code Here

  public Fragmenter getFragmenter(String fieldName, SolrParams params )
  {
    numRequests++;       
    if( defaults != null ) {
      params = new DefaultSolrParams( params, defaults );
    }
    int fragsize  = params.getFieldInt(   fieldName, HighlightParams.FRAGSIZE,  LuceneRegexFragmenter.DEFAULT_FRAGMENT_SIZE );
    int increment = params.getFieldInt(   fieldName, HighlightParams.INCREMENT, LuceneRegexFragmenter.DEFAULT_INCREMENT_GAP );
    float slop    = params.getFieldFloat( fieldName, HighlightParams.SLOP,      LuceneRegexFragmenter.DEFAULT_SLOP );
    int maxchars  = params.getFieldInt(   fieldName, HighlightParams.MAX_RE_CHARS, LuceneRegexFragmenter.DEFAULT_MAX_ANALYZED_CHARS );
View Full Code Here

{
  public Formatter getFormatter(String fieldName, SolrParams params )
  {
    numRequests++;
    if( defaults != null ) {
      params = new DefaultSolrParams( params, defaults );
    }
   
    return new SimpleHTMLFormatter(
        params.getFieldParam(fieldName, HighlightParams.SIMPLE_PRE,  "<em>" ),
        params.getFieldParam(fieldName, HighlightParams.SIMPLE_POST, "</em>"));
View Full Code Here

    assertEquals(p.getInt("i").intValue(), 555);
    assertEquals(p.getInt("i",5), 555);
    assertEquals(p.getInt("iii",5), 5);
    assertEquals(p.getFieldParam("field1","i"), "555");

    req.setParams(new DefaultSolrParams(p, new MapSolrParams(m)));
    p = req.getParams();
    assertEquals(req.getOriginalParams().get("s"), "bbb");
    assertEquals(p.get("i"), "555");
    assertEquals(p.getInt("i").intValue(), 555);
    assertEquals(p.getInt("i",5), 555);
View Full Code Here

    wparams.set( CommonParams.VERSION, parser.getVersion());
    if( params == null ) {
      params = wparams;
    }
    else {
      params = new DefaultSolrParams( wparams, params );
    }

    if( this._invariantParams != null ) {
      params = new DefaultSolrParams( this._invariantParams, params );
    }


    byte[] result = null;
    final HTTPClient client = new HTTPClient();
View Full Code Here

TOP

Related Classes of org.apache.solr.common.params.DefaultSolrParams

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.