Commit 75ce22dc authored by Eugen G.'s avatar Eugen G.
Browse files

initial setup

parents
/mosiapp/.metadata/src/main/webapp/WEB-INF/faces-config.pageflow
alter table content modify id BIGINT ;
\ No newline at end of file
CREATE TABLE articles (
id INT UNSIGNED AUTO_INCREMENT NOT NULL PRIMARY KEY,
title VARCHAR(200),
body TEXT,
FULLTEXT (title,body)
);
INSERT INTO articles (title,body) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...'),
('How To Use MySQL Well','After you went through a ...'),
('Optimizing MySQL','In this tutorial we will show ...'),
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...'),
('MySQL vs. YourSQL','In the following database comparison ...'),
('MySQL Security','When configured properly, MySQL ...');
select * from articles
SELECT * FROM articles
WHERE MATCH (title,body) AGAINST ('database');
\ No newline at end of file
drop table mosi.points;
drop table mosi.content;
ALTER DATABASE mosi CHARACTER SET utf8 COLLATE utf8_unicode_ci;
CREATE TABLE mosi.content (
id MEDIUMINT NOT NULL PRIMARY KEY AUTO_INCREMENT,
title TEXT NOT NULL,
description TEXT,
url VARCHAR(512) NOT NULL,
FULLTEXT ( title , description )
);
CREATE TABLE mosi.points (
id MEDIUMINT AUTO_INCREMENT NOT NULL PRIMARY KEY,
c_id MEDIUMINT NOT NULL,
clicks MEDIUMINT DEFAULT 1,
update_timestamp TIMESTAMP DEFAULT CURRENT_TIMESTAMP on UPDATE CURRENT_TIMESTAMP,
CONSTRAINT FOREIGN KEY (c_id) REFERENCES content (id)
);
drop trigger mosi.content_points_trigger;
CREATE TRIGGER mosi.content_points_trigger AFTER INSERT ON content
FOR EACH ROW INSERT INTO points SET c_id = NEW.id;
CREATE TRIGGER mosi.content_create_timestamp BEFORE INSERT ON content
FOR EACH ROW SET create_timestamp = now();
INSERT INTO content (title,description,url) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...','http://localhost:8080/mosiapp/'),
('How To Use MySQL Well','After you went through a ...','http://localhost:8080/mosiapp/'),
('Optimizing MySQL','In this tutorial we will show ...','http://localhost:8080/mosiapp/'),
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...','http://localhost:8080/mosiapp/'),
('MySQL vs. YourSQL','In the following database comparison ...','http://localhost:8080/mosiapp/'),
('MySQL Security','When configured properly, MySQL ...','http://localhost:8080/mosiapp/');
INSERT INTO content (title,description,url) VALUES
('MyOpenSearchInfo','MOSI stands for My Open Search InfoRMATION ...','http://www.MyOpenSearch.Info');
SELECT * FROM content WHERE MATCH (title, description) AGAINST ('database');
SELECT * FROM content WHERE MATCH (title, description) AGAINST ('Tutorial');
SELECT * FROM content WHERE MATCH (title, description) AGAINST ('configured');
SELECT * FROM content WHERE MATCH (title, description) AGAINST ('mosi');
SELECT * FROM content WHERE MATCH (title, description) AGAINST ('MyOpenSearchInfo' WITH QUERY EXPANSION);
select * from content
select * from points
SHOW VARIABLES
SELECT *, MATCH (title, description) AGAINST ('mysql') FROM content;
SELECT *, MATCH (title,description) AGAINST
('Security implications of running MySQL as root') AS score
FROM content WHERE MATCH (title,description) AGAINST
('Security implications of running MySQL as root');
SELECT *, MATCH (title,description) AGAINST ('MySQL') as score from content c, points p where c.id = p.c_id
and MATCH (title,description) AGAINST ('MySQL') order by (p.clicks / 100 + score) desc;
update points set clicks = 100 where c_id = 106;
SHOW VARIABLES LIKE "%version%";
--STATUS;
\ No newline at end of file
/*CREATE DATABASE mosi;*/
CREATE DATABASE mosi DEFAULT CHARACTER SET utf8 DEFAULT COLLATE utf8_general_ci;
CREATE USER mosijobson IDENTIFIED BY 'swordfish';
GRANT select, insert, update, delete ON mosi.* TO 'mosijobson'@'%';
CREATE TABLE mosi.content (id INT(11) NOT NULL AUTO_INCREMENT, title text NOT NULL, description text NOT NULL, url VARCHAR(512) NOT NULL, PRIMARY KEY (id) );
ALTER TABLE mosi.content ENGINE = MyISAM ;
ALTER TABLE `mosi`.`content`
drop INDEX `FULLTEXT`;
CREATE FULLTEXT INDEX `FULLTEXT` on `mosi`.`content` (`title` ASC, `description` ASC);
ALTER TABLE `mosi`.`content` MODIFY description text NOT NULL;
ALTER TABLE `mosi`.`content` change subject title text NOT NULL;
commit;
SELECT url, title, description FROM mosi.CONTENT WHERE MATCH (title, description) AGAINST ('find' WITH QUERY EXPANSION);
SELECT url, title, description FROM mosi.CONTENT WHERE MATCH (title, description) AGAINST ('find');
INSERT INTO mosi.CONTENT (title,description,url) VALUES
('MySQL Tutorial','DBMS stands for DataBase ...','www.oracle.com'),
('How To Use MySQL Well','After you went through a ...','www.oracle.com'),
('Optimizing MySQL','In this tutorial we will show ...','www.oracle.com'),
('1001 MySQL Tricks','1. Never run mysqld as root. 2. ...','www.oracle.com'),
('MySQL vs. YourSQL','In the following database comparison ...','www.oracle.com'),
('MySQL Security','When configured properly, MySQL ...','www.oracle.com');
SELECT * FROM mosi.CONTENT WHERE MATCH (title,description) AGAINST ('database');
SELECT * FROM mosi.CONTENT WHERE MATCH (title,description) AGAINST ('find');
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry excluding="**" kind="src" output="target/classes" path="src/main/resources">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="test" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.7">
<attributes>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jst.server.core.container/org.eclipse.jst.server.tomcat.runtimeTarget/Apache Tomcat v7.0">
<attributes>
<attribute name="owner.project.facets" value="jst.web"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/classes"/>
</classpath>
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>mosiapp</name>
<comment></comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.common.project.facet.core.builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.m2e.core.maven2Builder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.wst.validation.validationbuilder</name>
<arguments>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jem.workbench.JavaEMFNature</nature>
<nature>org.eclipse.wst.common.modulecore.ModuleCoreNature</nature>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>org.eclipse.m2e.core.maven2Nature</nature>
<nature>org.eclipse.wst.common.project.facet.core.nature</nature>
<nature>org.eclipse.wst.jsdt.core.jsNature</nature>
</natures>
</projectDescription>
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry excluding="**/bower_components/*|**/node_modules/*|**/*.min.js" kind="src" path="src/main/webapp"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.JRE_CONTAINER"/>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.WebProject">
<attributes>
<attribute name="hide" value="true"/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.wst.jsdt.launching.baseBrowserLibrary"/>
<classpathentry kind="output" path=""/>
</classpath>
eclipse.preferences.version=1
encoding//src/main/resources=UTF-8
encoding/<project>=UTF-8
eclipse.preferences.version=1
org.eclipse.jdt.core.compiler.codegen.inlineJsrBytecode=enabled
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.7
org.eclipse.jdt.core.compiler.compliance=1.7
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
org.eclipse.jdt.core.compiler.release=disabled
org.eclipse.jdt.core.compiler.source=1.7
eclipse.preferences.version=1
org.eclipse.jpt.core.platform=generic2_1
org.eclipse.jpt.jpa.core.discoverAnnotatedClasses=true
activeProfiles=
eclipse.preferences.version=1
resolveWorkspaceProjects=true
version=1
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
<wb-module deploy-name="mosiapp-1.0.3-RC.4">
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/resources"/>
<property name="context-root" value="mosiapp"/>
<property name="java-output-path" value="/mosiapp/target/classes"/>
</wb-module>
</project-modules>
<root>
<facet id="jpt.jpa">
<node name="libprov">
<attribute name="provider-id" value="jpa-no-op-library-provider"/>
</node>
</facet>
<facet id="jst.jsf">
<node name="libprov">
<attribute name="provider-id" value="jsf-no-op-library-provider"/>
</node>
</facet>
</root>
<?xml version="1.0" encoding="UTF-8"?>
<faceted-project>
<runtime name="Apache Tomcat v7.0"/>
<fixed facet="wst.jsdt.web"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.web" version="2.5"/>
<installed facet="jpt.jpa" version="2.1"/>
<installed facet="jst.jsf" version="2.2"/>
<installed facet="wst.jsdt.web" version="1.0"/>
</faceted-project>
org.eclipse.wst.jsdt.launching.baseBrowserLibrary
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment