Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Features/implement async on full text query impl #3

Open
wants to merge 45 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
45 commits
Select commit Hold shift + click to select a range
a40548c
NXTGEN-519 Updating the projects to .net core 3.1
Nov 2, 2020
22850b0
NXTGEN-519 removing more junk from the test csproj
Nov 2, 2020
9a6d7e1
NXTGEN-519 Moved package.config contents to csproj files
Nov 2, 2020
8d23dfc
updating nunit packages to NUnit 3
joshluth Nov 2, 2020
f08ab54
more project cleanup for nhibernate.search.tests
joshluth Nov 2, 2020
e327683
some more project cleanup
joshluth Nov 2, 2020
0048d6e
NXTGEN-519 Re-added all the .hbm.xml file inclusions in the test.csproj
Nov 3, 2020
ab3b2e6
Adding hibernate.cfg.xml to tests so they run better
codekaizen Nov 4, 2020
e4eb6cf
Updating NH to 5.x and fixing up interfaces and tests
codekaizen Nov 4, 2020
24e8fac
moved to setup
Nov 4, 2020
753c2bb
Force add of ignored hibernate.cfg.xml
codekaizen Nov 4, 2020
0aebb2d
Merge remote-tracking branch 'origin/wip/Update-NHibernate' into feat…
Nov 4, 2020
182afdc
NXTGEN-519 A little cleanup (removing unnecessary test project and co…
Nov 4, 2020
59f0d0c
Merge pull request #1 from esha/features/NXTGEN-519-Update-NHibernate…
EthanEiter Nov 4, 2020
c90b61c
NXTGEN-531 Updated the reference to NHibernate to 5.3.4 and wip fixin…
Nov 5, 2020
340de72
NXTGEN-546 Resolving some build errors
Nov 6, 2020
fd17bc3
Removed boast and hit
Nov 6, 2020
e226e63
First round of errors sloved, Errors resolved around
Nov 6, 2020
e4176e0
NXTGEN-546 WIP resolving more build errors
Nov 10, 2020
159c0dc
NXTGEN-546 WIP resolving more build errors
Nov 11, 2020
eed5137
NXTGEN-546 Build errors cropped down to a handful
Nov 12, 2020
e85f044
NXTGEN-546 Resolved all build errors
Nov 12, 2020
c3669cc
Fixing up tests and re-adding SharedReaderProvider synchronization
codekaizen Nov 13, 2020
29b345a
Merge pull request #2 from esha/features/NXTGEN-546-Update-Lucene-to-480
EthanEiter Nov 13, 2020
273edd7
NXTGEN-576 Retarteting to .NetStandard2.1
Nov 20, 2020
d89dab2
Merge pull request #3 from esha/features/NXTGEN-576-Target-dotNetStan…
EthanEiter Nov 20, 2020
505eff8
NXTGEN-580 Removed nuspec
Nov 20, 2020
18c56c4
Merge pull request #4 from esha/features/NXTGEN-580-Remove-nuspec
EthanEiter Nov 20, 2020
b016184
NXTGEN-691 InitAnalyzer returns StandardAnalyzer and only StandardAna…
Feb 18, 2021
f1575b0
NXTGEN-691 Added back the InitAnalyzer method (in a comment) and adde…
Feb 18, 2021
7aa67c5
Merge pull request #6 from esha/features/NXTGEN-691-NHSearch-InitAnal…
EthanEiter Feb 18, 2021
a699978
NXTGEN-691 Changing the assembly name in the csproj so when nuget pac…
Feb 19, 2021
f580a00
NXTGEN-691 Decisions have been made
Feb 19, 2021
75c5369
Merge pull request #7 from esha/features/NXTGEN-691-NHSearch-InitAnal…
EthanEiter Feb 22, 2021
024d31c
NXTGEN-710 Crudely implemented the Async variant tasks in FullTextInd…
Feb 25, 2021
f994109
NXTGEN-710 fixing typo
Feb 25, 2021
8cebeba
NXTGEN-710 Added async/await
Feb 25, 2021
ea27bef
Merge pull request #8 from esha/features/NXTGEN-710-implement-unimple…
EthanEiter Feb 25, 2021
b7ee8de
Implementing async loaders and wiring into async methods of FullTextQ…
codekaizen Mar 28, 2021
60314bb
Fixing mixed tab/space
codekaizen Mar 29, 2021
57c6442
Implementing delegation of all ISession methods in FullTextSessionImpl
codekaizen Mar 29, 2021
f513c5b
Fixing some unit test issues and adding temp nuget package info to build
codekaizen Mar 30, 2021
4b186b9
Merge pull request #9 from esha/features/Implement-Async-On-FullTextQ…
codekaizen Mar 30, 2021
1521446
NXTGEN-497 Adding classfield to getDocument
Apr 22, 2021
8dfba30
Merge branch 'master' into features/Implement-Async-On-FullTextQueryImpl
Apr 22, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -39,4 +39,5 @@ hibernate.cfg.xml
available-test-configurations
current-test-configuration
NHibernate.VisualState.xml
src/.vs
src/.vs
/.vs/slnx.sqlite
23 changes: 0 additions & 23 deletions NHibernate.Search.Esha.nuspec

This file was deleted.

29 changes: 23 additions & 6 deletions src/NHibernate.Search.Tests/Analyzer/AbstractTestAnalyzer.cs
Original file line number Diff line number Diff line change
@@ -1,20 +1,30 @@
using System;
using System.IO;
using Lucene.Net.Analysis;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.Util;

namespace NHibernate.Search.Tests.Analyzer
{
public abstract class AbstractTestAnalyzer : Lucene.Net.Analysis.Analyzer
{
protected abstract string[] Tokens { get; }
private readonly LuceneVersion _version;

public override TokenStream TokenStream(string fieldName, TextReader reader)
protected AbstractTestAnalyzer(LuceneVersion version)
{
return new InternalTokenStream(Tokens);
_version = version;
}

protected abstract string[] Tokens { get; }

/// <inheritdoc />
protected override TokenStreamComponents CreateComponents(String fieldName, TextReader reader) =>
new TokenStreamComponents(
new StandardTokenizer(_version, reader), new InternalTokenStream(Tokens));

#region Nested type: InternalTokenStream

private class InternalTokenStream : TokenStream
private sealed class InternalTokenStream : TokenStream
{
private readonly string[] tokens;
private int position;
Expand All @@ -24,9 +34,16 @@ public InternalTokenStream(string[] tokens)
this.tokens = tokens;
}

public override Token Next()
/// <inheritdoc />
public override Boolean IncrementToken()
{
return position >= tokens.Length ? null : new Token(tokens[position++], 0, 0);
if (position < tokens.Length)
{
position++;
return true;
}

return false;
}
}

Expand Down
4 changes: 3 additions & 1 deletion src/NHibernate.Search.Tests/Analyzer/AnalyzerTest.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
using System.Collections;
using Lucene.Net.Analysis.Standard;
using Lucene.Net.QueryParsers;
using Lucene.Net.QueryParsers.Classic;
using Lucene.Net.Util;
using NUnit.Framework;

namespace NHibernate.Search.Tests.Analyzer
Expand Down Expand Up @@ -31,7 +33,7 @@ public void TestScopedAnalyzers()

tx = s.BeginTransaction();

QueryParser parser = new QueryParser("id", new StandardAnalyzer());
QueryParser parser = new QueryParser(LuceneVersion.LUCENE_48, "id", new StandardAnalyzer(LuceneVersion.LUCENE_48));
Lucene.Net.Search.Query luceneQuery = parser.Parse("entity:alarm");
IFullTextQuery query = s.CreateFullTextQuery(luceneQuery, typeof(MyEntity));
Assert.AreEqual(1, query.ResultSize, "Entity query");
Expand Down
6 changes: 6 additions & 0 deletions src/NHibernate.Search.Tests/Analyzer/Test1Analyzer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Util;

namespace NHibernate.Search.Tests.Analyzer
{
Expand All @@ -12,5 +13,10 @@ protected override string[] Tokens
{
get { return tokens; }
}

/// <inheritdoc />
public Test1Analyzer(LuceneVersion version) : base(version)
{
}
}
}
6 changes: 6 additions & 0 deletions src/NHibernate.Search.Tests/Analyzer/Test2Analyzer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Util;

namespace NHibernate.Search.Tests.Analyzer
{
Expand All @@ -12,5 +13,10 @@ protected override string[] Tokens
{
get { return tokens; }
}

/// <inheritdoc />
public Test2Analyzer(LuceneVersion version) : base(version)
{
}
}
}
6 changes: 6 additions & 0 deletions src/NHibernate.Search.Tests/Analyzer/Test3Analyzer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Util;

namespace NHibernate.Search.Tests.Analyzer
{
Expand All @@ -12,5 +13,10 @@ protected override string[] Tokens
{
get { return tokens; }
}

/// <inheritdoc />
public Test3Analyzer(LuceneVersion version) : base(version)
{
}
}
}
6 changes: 6 additions & 0 deletions src/NHibernate.Search.Tests/Analyzer/Test4Analyzer.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
using System;
using System.Collections.Generic;
using System.Text;
using Lucene.Net.Util;

namespace NHibernate.Search.Tests.Analyzer
{
Expand All @@ -12,5 +13,10 @@ protected override string[] Tokens
{
get { return tokens; }
}

/// <inheritdoc />
public Test4Analyzer(LuceneVersion version) : base(version)
{
}
}
}
153 changes: 78 additions & 75 deletions src/NHibernate.Search.Tests/App.config
Original file line number Diff line number Diff line change
@@ -1,90 +1,93 @@
<?xml version="1.0"?>
<configuration>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>
<configSections>
<section name="hibernate-configuration" type="NHibernate.Cfg.ConfigurationSectionHandler, NHibernate"/>
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler,log4net"/>
</configSections>

<connectionStrings>
<add name="TestConnectionString" connectionString="TestConnectionString-TestConnectionString"/>
</connectionStrings>
<connectionStrings>
<add name="TestConnectionString" connectionString="TestConnectionString-TestConnectionString"/>
</connectionStrings>

<!--
hibernate-configuration section
<!--
hibernate-configuration section

You don't need to change this section for your own use.
You can write your own hibernate.cfg.xml to override all session-factory configuration.
Templates are available in NHibernate.Config.Templates folder.
-->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<bytecode-provider type="lcg"/>
<reflection-optimizer use="true"/>
<session-factory name="NHibernate.Test">
<property name="connection.provider">NHibernate.Test.DebugConnectionProvider, NHibernate.Search.Tests</property>
<property name="connection.isolation">ReadCommitted</property>
You don't need to change this section for your own use.
You can write your own hibernate.cfg.xml to override all session-factory configuration.
Templates are available in NHibernate.Config.Templates folder.
-->
<hibernate-configuration xmlns="urn:nhibernate-configuration-2.2">
<bytecode-provider type="lcg"/>
<reflection-optimizer use="true"/>
<session-factory name="NHibernate.Test">
<property name="connection.provider">NHibernate.Test.DebugConnectionProvider, NHibernate.Search.Tests</property>
<property name="connection.isolation">ReadCommitted</property>

<!-- This is the System.Data.dll provider for MSSQL Server -->
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.connection_string">Server=.\sqlexpress;initial catalog=nhsearch;Integrated Security=SSPI</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="adonet.batch_size">10</property>
<property name="prepare_sql">false</property>
<property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property>
<property name="cache.use_query_cache">true</property>

<!-- the following part is not read by the test, they are here being a template-->
<listener class="NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search" type="post-insert"/>
<listener class="NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search" type="post-update"/>
<listener class="NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search" type="post-delete"/>
<listener class="NHibernate.Search.Event.FullTextIndexCollectionEventListener, NHibernate.Search" type="post-collection-recreate"/>
<listener class="NHibernate.Search.Event.FullTextIndexCollectionEventListener, NHibernate.Search" type="post-collection-remove"/>
<listener class="NHibernate.Search.Event.FullTextIndexCollectionEventListener, NHibernate.Search" type="post-collection-update"/>
</session-factory>
</hibernate-configuration>
<!-- This is the System.Data.dll provider for MSSQL Server -->
<property name="dialect">NHibernate.Dialect.MsSql2008Dialect</property>
<property name="connection.connection_string">Server=.\sqlexpress;initial catalog=nhsearch;Integrated Security=SSPI</property>
<property name="query.substitutions">true 1, false 0, yes 'Y', no 'N'</property>
<property name="adonet.batch_size">10</property>
<property name="prepare_sql">false</property>
<property name="cache.provider_class">NHibernate.Cache.HashtableCacheProvider, NHibernate</property>
<property name="cache.use_query_cache">true</property>

<!-- This section contains the log4net configuration settings -->
<log4net debug="false">
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
</layout>
</appender>
<!-- the following part is not read by the test, they are here being a template-->
<listener class="NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search" type="post-insert"/>
<listener class="NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search" type="post-update"/>
<listener class="NHibernate.Search.Event.FullTextIndexEventListener, NHibernate.Search" type="post-delete"/>
<listener class="NHibernate.Search.Event.FullTextIndexCollectionEventListener, NHibernate.Search" type="post-collection-recreate"/>
<listener class="NHibernate.Search.Event.FullTextIndexCollectionEventListener, NHibernate.Search" type="post-collection-remove"/>
<listener class="NHibernate.Search.Event.FullTextIndexCollectionEventListener, NHibernate.Search" type="post-collection-update"/>
</session-factory>
</hibernate-configuration>

<appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
</layout>
</appender>
<!-- This section contains the log4net configuration settings -->
<log4net debug="false">
<appender name="trace" type="log4net.Appender.TraceAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
</layout>
</appender>

<appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
<param name="File" value="log.txt"/>
<param name="AppendToFile" value="false"/>
<param name="RollingStyle" value="Date"/>
<param name="DatePattern" value="yyyy.MM.dd"/>
<param name="StaticLogFileName" value="true"/>
<appender name="console" type="log4net.Appender.ConsoleAppender, log4net">
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d{ABSOLUTE} %-5p %c{1}:%L - %m%n"/>
</layout>
</appender>

<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
</layout>
</appender>
<appender name="rollingFile" type="log4net.Appender.RollingFileAppender,log4net">
<param name="File" value="log.txt"/>
<param name="AppendToFile" value="false"/>
<param name="RollingStyle" value="Date"/>
<param name="DatePattern" value="yyyy.MM.dd"/>
<param name="StaticLogFileName" value="true"/>

<!-- Setup the root category, add the appenders and set the default priority -->
<root>
<priority value="WARN"/>
<appender-ref ref="rollingFile"/>
</root>
<layout type="log4net.Layout.PatternLayout,log4net">
<param name="ConversionPattern" value="%d [%t] %-5p %c - %m%n"/>
</layout>
</appender>

<logger name="NHibernate.Bytecode.CodeDom">
<priority value="OFF"/>
</logger>
<!-- Setup the root category, add the appenders and set the default priority -->
<root>
<priority value="WARN"/>
<appender-ref ref="rollingFile"/>
</root>

<logger name="NHibernate.SQL">
<level value="OFF"/>
</logger>
<logger name="NHibernate.Bytecode.CodeDom">
<priority value="OFF"/>
</logger>

<logger name="NHibernate.Tool.hbm2ddl.SchemaExport">
<level value="WARN"/>
</logger>
</log4net>
<logger name="NHibernate.SQL">
<level value="OFF"/>
</logger>

<startup><supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/></startup></configuration>
<logger name="NHibernate.Tool.hbm2ddl.SchemaExport">
<level value="WARN"/>
</logger>
</log4net>

<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.0"/>
</startup>
</configuration>
Loading