zoukankan      html  css  js  c++  java
  • lucene-solr本地调试方法

    1.下载并编译lucene-solr的源代码,并导入 eclipse sts等

    2.修改SolrDispatchFilter的solr.solr.home属性,我们这里将其直接修改为一个本地绝对路径,以便能够直接启动:

          //String solrHome = (String) config.getServletContext().getAttribute(SOLRHOME_ATTRIBUTE);
          String solrHome="E:\demo\lucene-solr\solr\server\solr";

    3.修改StartSolrJetty类

        WebAppContext bb = new WebAppContext();
        bb.setServer(server);
        bb.setContextPath("/solr");
        bb.setWar("solr/webapp/web");

    4.启动StartSolrJetty main方法

    SLF4J: Class path contains multiple SLF4J bindings.
    SLF4J: Found binding in [jar:file:/E:/demo/lucene-solr/solr/core/lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/E:/demo/lucene-solr/solr/solrj/test-lib/slf4j-log4j12-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: Found binding in [jar:file:/E:/demo/lucene-solr/solr/solr-ref-guide/lib/slf4j-simple-1.7.7.jar!/org/slf4j/impl/StaticLoggerBinder.class]
    SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
    SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
    0    INFO  (main) [    ] o.e.j.u.log Logging initialized @512ms
    >>> STARTING EMBEDDED JETTY SERVER, PRESS ANY KEY TO STOP
    186  INFO  (main) [    ] o.e.j.s.Server jetty-9.3.20.v20170531
    590  INFO  (main) [    ] o.e.j.w.StandardDescriptorProcessor NO JSP Support for /solr, did not find org.eclipse.jetty.jsp.JettyJspServlet
    645  ERROR (main) [    ] o.a.s.u.StartupLoggingUtils Missing Java Option solr.log.dir. Logging may be missing or incomplete.
    650  INFO  (main) [    ] o.a.s.s.SolrDispatchFilter  ___      _       Welcome to Apache Solr™ version 7.2.2
    650  INFO  (main) [    ] o.a.s.s.SolrDispatchFilter / __| ___| |_ _   Starting in standalone mode on port null
    650  INFO  (main) [    ] o.a.s.s.SolrDispatchFilter \__ / _  | '_|  Install dir: null
    664  INFO  (main) [    ] o.a.s.s.SolrDispatchFilter |___/\___/_|_|    Start time: 2019-03-06T08:37:17.132Z
    691  INFO  (main) [    ] o.a.s.c.SolrResourceLoader solr home defaulted to 'solr/' (could not find system property or JNDI)
    698  INFO  (main) [    ] o.a.s.c.SolrXmlConfig Loading container configuration from E:demolucene-solrsolrserversolrsolr.xml
    10482 INFO  (main) [    ] o.a.s.c.CorePropertiesLocator Found 1 core definitions underneath E:demolucene-solrsolrserversolr
    10484 INFO  (main) [    ] o.a.s.c.CorePropertiesLocator Cores are: [new_core]
    10490 INFO  (coreLoadExecutor-6-thread-1) [    ] o.a.s.c.TransientSolrCoreCacheDefault Allocating transient cache for 2147483647 transient cores
    10568 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........contribextractionlib filtered by .*.jar to classpath: E:demolucene-solrsolrserversolr........contribextractionlib
    10568 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........dist filtered by solr-cell-d.*.jar to classpath: E:demolucene-solrsolrserversolr........dist
    10568 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........contribclusteringlib filtered by .*.jar to classpath: E:demolucene-solrsolrserversolr........contribclusteringlib
    10569 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........dist filtered by solr-clustering-d.*.jar to classpath: E:demolucene-solrsolrserversolr........dist
    10569 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........contriblangidlib filtered by .*.jar to classpath: E:demolucene-solrsolrserversolr........contriblangidlib
    10569 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........dist filtered by solr-langid-d.*.jar to classpath: E:demolucene-solrsolrserversolr........dist
    10569 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........dist filtered by solr-ltr-d.*.jar to classpath: E:demolucene-solrsolrserversolr........dist
    10569 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........contribvelocitylib filtered by .*.jar to classpath: E:demolucene-solrsolrserversolr........contribvelocitylib
    10569 WARN  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Couldn't add files from E:demolucene-solrsolrserversolr........dist filtered by solr-velocity-d.*.jar to classpath: E:demolucene-solrsolrserversolr........dist
    10603 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.SolrIndexConfig IndexWriter infoStream solr logging is enabled
    10606 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrConfig Using Lucene MatchVersion: 7.2.2
    10794 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.s.IndexSchema [new_core] Schema name=example
    10977 INFO  (main) [    ] o.e.j.s.h.ContextHandler Started o.e.j.w.WebAppContext@6e9175d8{/solr,file:///E:/demo/lucene-solr/solr/webapp/web/,AVAILABLE}{solr/webapp/web}
    10998 INFO  (main) [    ] o.e.j.s.AbstractConnector Started ServerConnector@74d1dc36{HTTP/1.1,[http/1.1]}{0.0.0.0:8983}
    10998 INFO  (main) [    ] o.e.j.s.Server Started @11529ms
    11572 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Registered ManagedResource impl org.apache.solr.rest.schema.analysis.ManagedWordSetResource for path /schema/analysis/stopwords/english
    11573 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Registered ManagedResource impl org.apache.solr.rest.schema.analysis.ManagedSynonymGraphFilterFactory$SynonymManager for path /schema/analysis/synonyms/english
    11573 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Added observer of type org.apache.solr.rest.schema.analysis.ManagedStopFilterFactory to existing ManagedResource /schema/analysis/stopwords/english
    11573 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Added observer of type org.apache.solr.rest.schema.analysis.ManagedSynonymGraphFilterFactory to existing ManagedResource /schema/analysis/synonyms/english
    11579 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.s.IndexSchema Loaded schema example/1.6 with uniqueid field item_no
    11579 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Added observer of type org.apache.solr.rest.schema.analysis.ManagedStopFilterFactory to existing ManagedResource /schema/analysis/stopwords/english
    11579 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Added observer of type org.apache.solr.rest.schema.analysis.ManagedSynonymGraphFilterFactory to existing ManagedResource /schema/analysis/synonyms/english
    11579 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Added observer of type org.apache.solr.rest.schema.analysis.ManagedStopFilterFactory to existing ManagedResource /schema/analysis/stopwords/english
    11579 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.RestManager Added observer of type org.apache.solr.rest.schema.analysis.ManagedSynonymGraphFilterFactory to existing ManagedResource /schema/analysis/synonyms/english
    11625 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.CoreContainer Creating SolrCore 'new_core' using configuration from instancedir E:demolucene-solrsolrserversolr, trusted=true
    11685 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrCore solr.RecoveryStrategy.Builder
    11691 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.c.SolrCore [[new_core] ] Opening new SolrCore at [E:demolucene-solrsolrserversolr], dataDir=[E:demolucene-solrsolrserversolrdata]
    11847 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.XSLTResponseWriter xsltCacheLifetimeSeconds=5
    21333 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.UpdateHandler Using UpdateLog implementation: org.apache.solr.update.UpdateLog
    21333 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.UpdateLog Initializing UpdateLog: dataDir= defaultSyncLevel=FLUSH numRecordsToKeep=100 maxNumLogsToKeep=10 numVersionBuckets=65536
    21356 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.CommitTracker Hard AutoCommit: if uncommited for 15000ms; 
    21357 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.CommitTracker Soft AutoCommit: disabled
    21474 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IFD][coreLoadExecutor-6-thread-1]: init: current segments file is "segments_3"; deletionPolicy=org.apache.solr.core.IndexDeletionPolicyWrapper@2801c812
    21474 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IFD][coreLoadExecutor-6-thread-1]: init: load commit "segments_3"
    21479 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IFD][coreLoadExecutor-6-thread-1]: now checkpoint "_0(7.2.2):C1 _1(7.2.2):C1" [2 segments ; isCommit = false]
    21479 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IFD][coreLoadExecutor-6-thread-1]: 0 msec to checkpoint
    21479 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: init: create=false
    21479 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: 
    dir=NRTCachingDirectory(MMapDirectory@E:demolucene-solrsolrserversolrdataindex lockFactory=org.apache.lucene.store.NativeFSLockFactory@340158a7; maxCacheMB=48.0 maxMergeSizeMB=4.0)
    index=_0(7.2.2):C1 _1(7.2.2):C1
    version=7.2.2
    analyzer=org.apache.solr.update.SolrIndexConfig$DelayedSchemaAnalyzer
    ramBufferSizeMB=100.0
    maxBufferedDocs=-1
    mergedSegmentWarmer=null
    delPolicy=org.apache.solr.core.IndexDeletionPolicyWrapper
    commit=null
    openMode=APPEND
    similarity=org.apache.lucene.search.similarities.DavidSimilarity
    mergeScheduler=ConcurrentMergeScheduler: maxThreadCount=-1, maxMergeCount=-1, ioThrottle=true
    codec=Lucene70
    infoStream=org.apache.solr.update.LoggingInfoStream
    mergePolicy=[TieredMergePolicy: maxMergeAtOnce=10, maxMergeAtOnceExplicit=30, maxMergedSegmentMB=5120.0, floorSegmentMB=2.0, forceMergeDeletesPctAllowed=10.0, segmentsPerTier=10.0, maxCFSSegmentSizeMB=8.796093022207999E12, noCFSRatio=0.1
    indexerThreadPool=org.apache.lucene.index.DocumentsWriterPerThreadPool@1266476d
    readerPooling=true
    perThreadHardLimitMB=1945
    useCompoundFile=false
    commitOnClose=true
    indexSort=null
    writer=org.apache.solr.update.SolrIndexWriter@35039ae8
    
    21480 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: MMapDirectory.UNMAP_SUPPORTED=true
    21481 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: flush at getReader
    21481 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [DW][coreLoadExecutor-6-thread-1]: startFullFlush
    21482 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: now apply all deletes for all segments buffered updates bytesUsed=0 reader pool bytesUsed=0
    21482 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [BD][coreLoadExecutor-6-thread-1]: waitApply: no deletes to apply
    21550 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: incRefDeleter for NRT reader version=10 segments=_0(7.2.2):C1 _1(7.2.2):C1
    21550 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: return reader version=10 reader=StandardDirectoryReader(segments_3:10:nrt _0(7.2.2):C1 _1(7.2.2):C1)
    21550 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [DW][coreLoadExecutor-6-thread-1]: coreLoadExecutor-6-thread-1 finishFullFlush success=true
    21551 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.u.LoggingInfoStream [IW][coreLoadExecutor-6-thread-1]: getReader took 69 msec
    21565 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.s.SolrIndexSearcher Opening [Searcher@6e7addcb[new_core] main]
    21578 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResourceStorage File-based storage initialized to use dir: E:demolucene-solrsolrserversolrconf
    21580 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResourceStorage Loaded LinkedHashMap at path _rest_managed.json using file:dir=E:demolucene-solrsolrserversolrconf
    21580 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResource Loaded initArgs {} for /rest/managed
    21581 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResourceStorage Loaded LinkedHashMap at path _schema_analysis_stopwords_english.json using file:dir=E:demolucene-solrsolrserversolrconf
    21581 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResource Loaded initArgs {ignoreCase=true} for /schema/analysis/stopwords/english
    21581 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.s.a.ManagedWordSetResource Loaded 35 words for /schema/analysis/stopwords/english
    21582 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResource Notified 4 observers of /schema/analysis/stopwords/english
    21582 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResourceStorage Loaded LinkedHashMap at path _schema_analysis_synonyms_english.json using file:dir=E:demolucene-solrsolrserversolrconf
    21582 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResource Loaded initArgs {ignoreCase=true,format=solr} for /schema/analysis/synonyms/english
    21583 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.s.a.ManagedSynonymGraphFilterFactory Loaded 3 synonym mappings for /schema/analysis/synonyms/english
    21585 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.r.ManagedResource Notified 4 observers of /schema/analysis/synonyms/english
    21600 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.h.c.SpellCheckComponent Initializing spell checkers
    21610 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.s.DirectSolrSpellChecker init: {name=default,field=text,classname=solr.DirectSolrSpellChecker,distanceMeasure=internal,accuracy=0.5,maxEdits=2,minPrefix=1,maxInspections=5,minQueryLength=4,maxQueryFrequency=0.01}
    21621 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.h.c.SuggestComponent Initializing SuggestComponent
    21624 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.s.s.SolrSuggester init: {name=mySuggester,lookupImpl=FuzzyLookupFactory,dictionaryImpl=DocumentDictionaryFactory,field=cat,weightField=price,suggestAnalyzerFieldType=string,buildOnStartup=false}
    21649 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.s.s.SolrSuggester Dictionary loaded with params: {name=mySuggester,lookupImpl=FuzzyLookupFactory,dictionaryImpl=DocumentDictionaryFactory,field=cat,weightField=price,suggestAnalyzerFieldType=string,buildOnStartup=false}
    21651 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.h.c.QueryElevationComponent Loading QueryElevation from: E:demolucene-solrsolrserversolrconfelevate.xml
    21667 INFO  (coreLoadExecutor-6-thread-1) [    x:new_core] o.a.s.h.ReplicationHandler Commits will be reserved for 10000ms.
    21786 INFO  (searcherExecutor-7-thread-1-processing-x:new_core) [    x:new_core] o.a.s.c.QuerySenderListener QuerySenderListener sending requests to Searcher@6e7addcb[new_core] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_0(7.2.2):C1) Uninverting(_1(7.2.2):C1)))}
    21870 INFO  (searcherExecutor-7-thread-1-processing-x:new_core) [    x:new_core] o.a.s.c.S.Request [new_core]  webapp=null path=null params={q=static+firstSearcher+warming+in+solrconfig.xml&distrib=false&event=firstSearcher} hits=0 status=0 QTime=81
    21871 INFO  (searcherExecutor-7-thread-1-processing-x:new_core) [    x:new_core] o.a.s.c.QuerySenderListener QuerySenderListener done.
    21871 INFO  (searcherExecutor-7-thread-1-processing-x:new_core) [    x:new_core] o.a.s.h.c.SpellCheckComponent Loading spell index for spellchecker: default
    21871 INFO  (searcherExecutor-7-thread-1-processing-x:new_core) [    x:new_core] o.a.s.h.c.SpellCheckComponent Loading spell index for spellchecker: wordbreak
    21875 INFO  (searcherExecutor-7-thread-1-processing-x:new_core) [    x:new_core] o.a.s.c.SolrCore [new_core] Registered new searcher Searcher@6e7addcb[new_core] main{ExitableDirectoryReader(UninvertingDirectoryReader(Uninverting(_0(7.2.2):C1) Uninverting(_1(7.2.2):C1)))}

     参考资料:

    【1】http://www.cnblogs.com/mmaa/p/5789860.html

  • 相关阅读:
    Swift中枚举的总结以及使用
    CapsLock Enhancement via AutoHotKey
    计算思维
    计算几何-凸包算法 Python实现与Matlab动画演示
    CapsLock魔改大法——变废为宝实现高效编辑
    Python调用Matlab2014b引擎
    VC++如何利用Matlab2014b的图形引擎进行绘图
    Window中C++进行精确计时的方法
    十四。算法小知识点
    十三。宫水三叶公众号总结
  • 原文地址:https://www.cnblogs.com/davidwang456/p/10484176.html
Copyright © 2011-2022 走看看