aboutsummaryrefslogtreecommitdiffstats
path: root/sample-apps
diff options
context:
space:
mode:
authorKristian Aune <kraune@yahoo-inc.com>2017-02-10 13:27:01 +0100
committerKristian Aune <kraune@yahoo-inc.com>2017-02-10 13:27:01 +0100
commit6c5d868cdcf031ab7345a4fc34a2edef89d7f951 (patch)
tree6a5f5eb190a191dde9ef2ae40fa1ebae9d46a893 /sample-apps
parent86cbd8917a11e8e920adbb1dfabc83f4f03fbfa0 (diff)
fix pom and config
- make it non-yahoo - pom.xml strictly not needed here as the app does not have java code
Diffstat (limited to 'sample-apps')
-rw-r--r--sample-apps/blog-search-initial/pom.xml158
-rw-r--r--sample-apps/blog-search-initial/src/main/application/hosts.xml7
-rw-r--r--sample-apps/blog-search-initial/src/main/application/searchdefinitions/blog_post.sd62
-rw-r--r--sample-apps/blog-search-initial/src/main/application/services.xml12
4 files changed, 155 insertions, 84 deletions
diff --git a/sample-apps/blog-search-initial/pom.xml b/sample-apps/blog-search-initial/pom.xml
index 33913190d92..cbe5967537a 100644
--- a/sample-apps/blog-search-initial/pom.xml
+++ b/sample-apps/blog-search-initial/pom.xml
@@ -1,85 +1,83 @@
<?xml version="1.0"?>
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
- <modelVersion>4.0.0</modelVersion>
- <groupId>com.yahoo.example</groupId>
- <artifactId>search</artifactId>
- <packaging>container-plugin</packaging>
- <version>0.0.1</version>
- <name>application</name>
+<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
+<project xmlns="http://maven.apache.org/POM/4.0.0"
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
+ http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+ <groupId>com.yahoo.example</groupId>
+ <artifactId>search</artifactId>
+ <packaging>container-plugin</packaging>
+ <version>0.0.1</version>
- <properties>
- <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
- <test.hide>true</test.hide>
- <application>blog-search</application>
- <instance>default</instance>
- </properties>
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ <test.hide>true</test.hide>
+ <vespa_version>6-SNAPSHOT</vespa_version>
+ </properties>
- <parent>
- <groupId>com.yahoo.vespa.tenant</groupId>
- <artifactId>base</artifactId>
- <version>RELEASE</version>
- </parent>
+ <dependencies>
+ <dependency>
+ <groupId>junit</groupId>
+ <artifactId>junit</artifactId>
+ <version>4.11</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>application</artifactId>
+ <version>${vespa_version}</version>
+ <scope>test</scope>
+ </dependency>
+ <dependency>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>container-dev</artifactId>
+ <version>${vespa_version}</version>
+ <scope>provided</scope>
+ </dependency>
+ </dependencies>
- <pluginRepositories>
- <pluginRepository>
- <id>ymaven</id>
- <url>http://ymaven.corp.yahoo.com:9999/proximity/repository/public</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>maven2-repository.dev.java.net</id>
- <url>http://download.java.net/maven/2</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- <pluginRepository>
- <id>vespa-maven-release</id>
- <name>vespa-maven-release</name>
- <url>http://edge.artifactory.yahoo.com:8000/artifactory/vespa-maven-libs-release-local</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </pluginRepository>
- </pluginRepositories>
- <repositories>
- <repository>
- <id>ymaven</id>
- <url>http://ymaven.corp.yahoo.com:9999/proximity/repository/public</url>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- <repository>
- <id>vespa-maven-release</id>
- <name>vespa-maven-release</name>
- <url>http://edge.artifactory.yahoo.com:8000/artifactory/vespa-maven-libs-release-local</url>
- <releases>
- <enabled>true</enabled>
- </releases>
- <snapshots>
- <enabled>false</enabled>
- </snapshots>
- </repository>
- </repositories>
-
- <build>
- <plugins>
- <plugin>
- <groupId>org.apache.maven.plugins</groupId>
- <artifactId>maven-compiler-plugin</artifactId>
- <configuration>
- <compilerArgs>
- <arg>-Xlint:all</arg>
- <arg>-Werror</arg>
- </compilerArgs>
- </configuration>
- </plugin>
- </plugins>
- </build>
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <optimize>true</optimize>
+ <showDeprecation>true</showDeprecation>
+ <showWarnings>true</showWarnings>
+ <source>1.8</source>
+ <target>1.8</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-surefire-plugin</artifactId>
+ <version>2.13</version>
+ <configuration>
+ <systemPropertyVariables>
+ <isMavenSurefirePlugin>true</isMavenSurefirePlugin>
+ </systemPropertyVariables>
+ <redirectTestOutputToFile>${test.hide}</redirectTestOutputToFile>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>vespa-application-maven-plugin</artifactId>
+ <version>${vespa_version}</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>packageApplication</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+ <plugin>
+ <groupId>com.yahoo.vespa</groupId>
+ <artifactId>bundle-plugin</artifactId>
+ <extensions>true</extensions>
+ </plugin>
+ </plugins>
+ </build>
</project>
diff --git a/sample-apps/blog-search-initial/src/main/application/hosts.xml b/sample-apps/blog-search-initial/src/main/application/hosts.xml
new file mode 100644
index 00000000000..3ab86a21aef
--- /dev/null
+++ b/sample-apps/blog-search-initial/src/main/application/hosts.xml
@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="utf-8" ?>
+<!-- Copyright 2016 Yahoo Inc. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root. -->
+<hosts>
+ <host name="localhost">
+ <alias>node1</alias>
+ </host>
+</hosts>
diff --git a/sample-apps/blog-search-initial/src/main/application/searchdefinitions/blog_post.sd b/sample-apps/blog-search-initial/src/main/application/searchdefinitions/blog_post.sd
new file mode 100644
index 00000000000..8d94d0bf6ba
--- /dev/null
+++ b/sample-apps/blog-search-initial/src/main/application/searchdefinitions/blog_post.sd
@@ -0,0 +1,62 @@
+search blog_post {
+ document blog_post {
+ field date_gmt type string {
+ indexing: summary
+ }
+ field language type string {
+ indexing: summary
+ }
+
+ field author type string {
+ indexing: summary
+ }
+
+ field url type string {
+ indexing: summary
+ }
+
+ field title type string {
+ indexing: summary | index
+ }
+
+ field blog type string {
+ indexing: summary
+ }
+
+ field post_id type string {
+ indexing: summary
+ }
+
+ field tags type array<string> {
+ indexing: summary
+ }
+
+ field blogname type string {
+ indexing: summary
+ }
+
+ field content type string {
+ indexing: summary | index
+ }
+
+ field categories type array<string> {
+ indexing: summary
+ }
+
+ field date type int {
+ indexing: summary | attribute
+ }
+
+ }
+
+ fieldset default {
+ fields: title, content
+ }
+
+ rank-profile post inherits default {
+ first-phase {
+ expression:nativeRank(title, content)
+ }
+ }
+}
+
diff --git a/sample-apps/blog-search-initial/src/main/application/services.xml b/sample-apps/blog-search-initial/src/main/application/services.xml
index 20f5fcde57f..1cb90214e2b 100644
--- a/sample-apps/blog-search-initial/src/main/application/services.xml
+++ b/sample-apps/blog-search-initial/src/main/application/services.xml
@@ -1,10 +1,12 @@
<?xml version='1.0' encoding='UTF-8'?>
-<services version='1.0' xmlns:deploy="vespa" xmlns:preprocess="properties">
+<services version='1.0'>
<jdisc id='default' version='1.0'>
<search/>
<document-api/>
- <nodes count='1'/>
+ <nodes>
+ <node hostalias='node1'/>
+ </nodes>
</jdisc>
<content id='blog_post' version='1.0'>
@@ -12,7 +14,9 @@
<documents>
<document mode='index' type='blog_post'/>
</documents>
- <nodes count='1'/>
+ <nodes>
+ <node hostalias='node1' distribution-key="0"/>
+ </nodes>
<engine>
<proton>
<searchable-copies>1</searchable-copies>
@@ -20,4 +24,4 @@
</engine>
</content>
-</services> \ No newline at end of file
+</services>