You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by nabil rabhi <na...@gmail.com> on 2010/03/26 14:17:56 UTC

how to apply patch SOLR-1316

I want to apply this patch http://issues.apache.org/jira/browse/SOLR-1316
to solr 1.4 so I can implement the autocomplete feature
ca anyone help?

Re: how to apply patch SOLR-1316

Posted by Koji Sekiguchi <ko...@r.email.ne.jp>.
> As you can see both versions don't appear to be working. I tried building
> each but neither would compile. Which version/tag should be used when
> applying this patch?
>
>    
In general, a patch is written against the latest trunk branch
as of then. For the SOLR-1316.patch, it was posted 2010-5-31,
you should check out the dated source from trunk:

$ svn co -r {2010-05-31} http://svn.apache.org/repos/asf/lucene/dev/trunk

Koji

-- 
http://www.rondhuit.com/en/


Re: how to apply patch SOLR-1316

Posted by Blargy <zm...@hotmail.com>.
Im trying to apply this via the command line "patch -p0 < SOLR-1316.patch".

When patching against trunk I get the following errors.

~/workspace $ patch -p0 < SOLR-1316.patch 
patching file
dev/trunk/solr/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
Hunk #2 succeeded at 575 (offset -3 lines).
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/SolrSpellChecker.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/BufferingTermFreqIteratorWrapper.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/FileDictionary.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Lookup.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/SortedTermFreqIteratorWrapper.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/UnsortedTermFreqIteratorWrapper.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookup.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellTernarySearchTrie.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/tst/TSTAutocomplete.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/tst/TSTLookup.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/tst/TernaryTreeNode.java
patching file
dev/trunk/solr/src/java/org/apache/solr/util/HighFrequencyDictionary.java
Hunk #1 FAILED at 54.
Hunk #2 FAILED at 69.
2 out of 2 hunks FAILED -- saving rejects to file
dev/trunk/solr/src/java/org/apache/solr/util/HighFrequencyDictionary.java.rej
patching file
dev/trunk/solr/src/java/org/apache/solr/util/SortedIterator.java
patching file
dev/trunk/solr/src/java/org/apache/solr/util/TermFreqIterator.java
patching file
dev/trunk/solr/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
patching file
dev/trunk/solr/src/test/test-files/solr/conf/schema-spellchecker.xml
patching file
dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml

Patching against the 1.4.0 tag I get the following errors

$ patch -p0 < SOLR-1316.patch 
patching file
dev/trunk/solr/src/java/org/apache/solr/handler/component/SpellCheckComponent.java
Hunk #1 succeeded at 102 (offset -5 lines).
Hunk #2 succeeded at 348 (offset -230 lines).
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/AbstractLuceneSpellChecker.java
Hunk #1 succeeded at 40 (offset 1 line).
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/IndexBasedSpellChecker.java
Hunk #1 succeeded at 105 (offset 3 lines).
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/SolrSpellChecker.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/BufferingTermFreqIteratorWrapper.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/FileDictionary.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Lookup.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/SortedTermFreqIteratorWrapper.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/Suggester.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/UnsortedTermFreqIteratorWrapper.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellLookup.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/jaspell/JaspellTernarySearchTrie.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/tst/TSTAutocomplete.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/tst/TSTLookup.java
patching file
dev/trunk/solr/src/java/org/apache/solr/spelling/suggest/tst/TernaryTreeNode.java
patching file
dev/trunk/solr/src/java/org/apache/solr/util/HighFrequencyDictionary.java
patching file
dev/trunk/solr/src/java/org/apache/solr/util/SortedIterator.java
patching file
dev/trunk/solr/src/java/org/apache/solr/util/TermFreqIterator.java
patching file
dev/trunk/solr/src/test/org/apache/solr/spelling/suggest/SuggesterTest.java
patching file
dev/trunk/solr/src/test/test-files/solr/conf/schema-spellchecker.xml
patching file
dev/trunk/solr/src/test/test-files/solr/conf/solrconfig-spellchecker.xml
Hunk #1 succeeded at 86 with fuzz 1 (offset -6 lines).

As you can see both versions don't appear to be working. I tried building
each but neither would compile. Which version/tag should be used when
applying this patch?

Thanks

-- 
View this message in context: http://lucene.472066.n3.nabble.com/how-to-apply-patch-SOLR-1316-tp676497p901887.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: how to apply patch SOLR-1316

Posted by Abdelhamid ABID <ae...@gmail.com>.
Well, The patch itself is a plain text by which a patch tool use to update a
project source, it's editable with any text editor.
You understand by this that you have to build the project yoursef after
applying the patch.

In general you need to:
- Download an IDE with svn client, Eclipse is a great one.
- Create a project from SVN by connecting to the Solr svn repo at
http://svn.apache.org/repos/asf/lucene/solr and checkout the version that
fulfill your requirements. Solr1.4 is under 'tag' folder.

- Download the patch you want to be applied.
- In your IDE, right click (not left click :) ) on the src folder, and
select 'team' or 'versioning' or what ever to apply the patch.
- Build using Eclipse or directly with Ant from the project folder in the
command line.


After successful build you can take your new brand Solr from dist folder
located in the project home.

I hope that this very very quick guide will be of help to you. I suggest
that you read further on  Java development life-cycle and tools.


On 3/26/10, nabil rabhi <na...@gmail.com> wrote:
>
> thanks for the reply Abdelhamid, but could you give me more details please?
>
> 2010/3/26 Abdelhamid ABID <ae...@gmail.com>
>
>
> > To apply the patch you need the source, you may have it from Solr svn,
> > using
> > an ide  will greatly make things friendly,
> > Applying the patch is a matter of left click on the project and .. "apply
> > patch" !
> >
> > On 3/26/10, nabil rabhi <na...@gmail.com> wrote:
> > >
> > > I want to apply this patch
> > http://issues.apache.org/jira/browse/SOLR-1316
> > > to solr 1.4 so I can implement the autocomplete feature
> > > ca anyone help?
> > >
> >
> >
> >
> > --
> > Abdelhamid ABID
> > Software Engineer- J2EE / WEB / ESB MULE
> >
>



-- 
Abdelhamid ABID
Software Engineer- J2EE / WEB / ESB MULE

Re: how to apply patch SOLR-1316

Posted by nabil rabhi <na...@gmail.com>.
thanks for the reply Abdelhamid, but could you give me more details please?

2010/3/26 Abdelhamid ABID <ae...@gmail.com>

> To apply the patch you need the source, you may have it from Solr svn,
> using
> an ide  will greatly make things friendly,
> Applying the patch is a matter of left click on the project and .. "apply
> patch" !
>
> On 3/26/10, nabil rabhi <na...@gmail.com> wrote:
> >
> > I want to apply this patch
> http://issues.apache.org/jira/browse/SOLR-1316
> > to solr 1.4 so I can implement the autocomplete feature
> > ca anyone help?
> >
>
>
>
> --
> Abdelhamid ABID
> Software Engineer- J2EE / WEB / ESB MULE
>

Re: how to apply patch SOLR-1316

Posted by Abdelhamid ABID <ae...@gmail.com>.
To apply the patch you need the source, you may have it from Solr svn, using
an ide  will greatly make things friendly,
Applying the patch is a matter of left click on the project and .. "apply
patch" !

On 3/26/10, nabil rabhi <na...@gmail.com> wrote:
>
> I want to apply this patch http://issues.apache.org/jira/browse/SOLR-1316
> to solr 1.4 so I can implement the autocomplete feature
> ca anyone help?
>



-- 
Abdelhamid ABID
Software Engineer- J2EE / WEB / ESB MULE